From e6880b5835605bc944378c79194a61f2faf55b20 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Wed, 29 Apr 2026 11:31:55 +0200 Subject: [PATCH] enh(avatar): add a fallback case when parsing the avatar attr: decode it as base64 Signed-off-by: Julien Veyssier --- lib/Service/ProvisioningService.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Service/ProvisioningService.php b/lib/Service/ProvisioningService.php index 55b59a580..1a62f9436 100644 --- a/lib/Service/ProvisioningService.php +++ b/lib/Service/ProvisioningService.php @@ -529,6 +529,13 @@ private function setUserAvatar(string $userId, string $avatarAttribute): void { $this->logger->warning('Failed to decode base64 JPEG avatar for user ' . $userId, ['avatar_attribute' => $avatarAttribute]); return; } + } else { + // fallback if it's not a URL and does not have a base64 data prefix: try to decode it as base64 + $avatarContent = base64_decode($avatarAttribute); + if ($avatarContent === false) { + $this->logger->warning('Failed to decode base64 unprefixed avatar for user ' . $userId, ['avatar_attribute' => $avatarAttribute]); + return; + } } if ($avatarContent === null || $avatarContent === '') {