]> git.mxchange.org Git - friendica.git/commitdiff
tests
authorMichael <heluecht@pirati.ca>
Fri, 18 Feb 2022 06:12:02 +0000 (06:12 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 18 Feb 2022 06:12:02 +0000 (06:12 +0000)
src/Model/Item.php

index 5b31a8078ac239f024d123e0acf796de6b1ccf91..8425d5dc3477dea7762734a643a965b976cb95ce 100644 (file)
@@ -1236,9 +1236,11 @@ class Item
                        return;
                }
 
-               $self = Contact::selectFirst(['id'], ['uid' => $item['uid'], 'self' => true]);
+               $self_contact = Contact::selectFirst(['id'], ['uid' => $item['uid'], 'self' => true]);
+               $self = !empty($self_contact) ? $self_contact['id'] : 0;
+               
                $cid = Contact::getIdForURL($author['url'], $item['uid']);
-               if (empty($cid) || (!Contact::isSharing($cid, $item['uid']) && ($cid != ($self['id'] ?? 0)))) {
+               if (empty($cid) || (!Contact::isSharing($cid, $item['uid']) && ($cid != $self))) {
                        Logger::info('The resharer is not a following contact: quit', ['resharer' => $author['url'], 'uid' => $item['uid'], 'cid' => $cid]);
                        return;
                }