From: Hypolite Petovan Date: Tue, 15 Feb 2022 20:59:35 +0000 (-0500) Subject: Check the existence of the `uid` field before accessing it in Module\Photo X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3b6c40e2e6ad59f09daef08cf09366c844edd23a;p=friendica.git Check the existence of the `uid` field before accessing it in Module\Photo - Address https://github.com/friendica/friendica/issues/11218#issuecomment-1039512291 --- diff --git a/src/Module/Photo.php b/src/Module/Photo.php index c67520b554..3d3110fd8b 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -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']);