Merge pull request #27124 from nextcloud/backport/26282/stable21

[stable21] improve type handling of Avatar::generateAvatarFromSvg
This commit is contained in:
Morris Jobke 2021-05-26 20:32:36 +02:00 committed by GitHub
commit afd58bd4bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -156,8 +156,9 @@ abstract class Avatar implements IAvatar {
$avatar->readImageBlob($svg);
$avatar->setImageFormat('png');
$image = new OC_Image();
$image->loadFromData($avatar);
return $image->data();
$image->loadFromData((string)$avatar);
$data = $image->data();
return $data === null ? false : $data;
} catch (\Exception $e) {
return false;
}