Merge pull request #11247 from MrPetovan/bug/notices

Check the existence of the `uid` field before accessing it in Module\Photo
This commit is contained in:
Michael Vogel 2022-02-16 01:06:23 +01:00 committed by GitHub
commit 18e0fb375b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -288,9 +288,10 @@ class Photo extends BaseModule
}
}
If (($contact['uid'] != 0) && empty($contact['photo']) && empty($contact['avatar'])) {
if (!empty($contact['uid']) && empty($contact['photo']) && empty($contact['avatar'])) {
$contact = Contact::getByURL($contact['url'], false, ['avatar', 'photo', 'xmpp', 'addr']);
}
if (!empty($contact['photo']) && !empty($contact['avatar'])) {
// Fetch photo directly
$resourceid = MPhoto::ridFromURI($contact['photo']);