From 35345e9aa72cd5370300afe20f89634da65b1dda Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Wed, 22 Nov 2023 11:07:58 +0100 Subject: [PATCH] User: Fix Resolution of Avatar --- .../User/classes/Avatar/class.ilUserAvatarResolver.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Services/User/classes/Avatar/class.ilUserAvatarResolver.php b/Services/User/classes/Avatar/class.ilUserAvatarResolver.php index ca1815dee524..32a98aad974d 100644 --- a/Services/User/classes/Avatar/class.ilUserAvatarResolver.php +++ b/Services/User/classes/Avatar/class.ilUserAvatarResolver.php @@ -170,12 +170,12 @@ public function getAvatar(bool $name_as_set_as_text_closely = false): Avatar public function getUserPictureForVCard(): array { - if (!$this->hasProfilePicture()) { + if (!$this->hasProfilePicture() + || $this->rid === '-') { return [null, null]; } if ($this->rid !== null - && $this->rid !== '-' && ($identification = $this->irss->manage()->find($this->rid)) !== null) { $flavour_streams = $this->irss->flavours() ->get($identification, $this->flavour_definition) @@ -214,9 +214,8 @@ public function getUserPictureForVCard(): array */ public function getLegacyPictureURL(): string { - if ($this->hasProfilePicture()) { - // IRSS - if ($this->rid !== null && $this->rid !== '-') { + if ($this->hasProfilePicture() && $this->rid !== '-') { + if ($this->rid !== null) { return $this->resolveProfilePicturePath(); }