Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: Fix avatar images
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal committed Apr 9, 2024
commit b2335b453e867fa6661cc059ae9f7535906d2e55
7 changes: 7 additions & 0 deletions lib/private/Avatar/AvatarManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ public function __construct(

/**
* return a user specific instance of \OCP\IAvatar
*
* If the user is disabled a guest avatar will be returned
*
* @see \OCP\IAvatar
* @param string $userId the ownCloud user id
* @return \OCP\IAvatar
Expand All @@ -113,6 +116,10 @@ public function getAvatar(string $userId) : IAvatar {
throw new \Exception('user does not exist');
}

if (!$user->isEnabled()) {
return $this->getGuestAvatar($userId);
}

// sanitize userID - fixes casing issue (needed for the filesystem stuff that is done below)
$userId = $user->getUID();

Expand Down