]> git.mxchange.org Git - friendica.git/commitdiff
Check array key existence in ActivityPub\Transmitter::createPermissionBlockForItem
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 19 Mar 2022 07:12:39 +0000 (03:12 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 19 Mar 2022 07:15:08 +0000 (03:15 -0400)
- APContact::getByURL can return empty array
- Address https://github.com/friendica/friendica/issues/11218#issuecomment-1066753232

src/Protocol/ActivityPub/Transmitter.php

index d602d9f86b202004824c44a206f94b4133c91d68..2cab827bb1afd937468687e1e542c0bf9988f897 100644 (file)
@@ -529,7 +529,7 @@ class Transmitter
                $parent = Post::selectFirst(['causer-link', 'post-reason'], ['id' => $item['parent']]);
                if (($parent['post-reason'] == Item::PR_ANNOUNCEMENT) && !empty($parent['causer-link'])) {
                        $profile = APContact::getByURL($parent['causer-link'], false);
-                       $is_forum_thread = ($profile['type'] == 'Group');
+                       $is_forum_thread = isset($profile['type']) && $profile['type'] == 'Group';
                } else {
                        $is_forum_thread = false;
                }