]> git.mxchange.org Git - friendica.git/commitdiff
Check the existence of the `uid` field before accessing it in Module\Photo
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 15 Feb 2022 20:59:35 +0000 (15:59 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 15 Feb 2022 20:59:35 +0000 (15:59 -0500)
- Address https://github.com/friendica/friendica/issues/11218#issuecomment-1039512291

src/Module/Photo.php

index c67520b554d92879e21e37e087388380f4a9ff6c..3d3110fd8b702fa2458c6c1a2ff61fc775b68637 100644 (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']);