]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/ActivityPub/ClientToServer.php
Issue 12977: Ensure to fetch quoted posts
[friendica.git] / src / Protocol / ActivityPub / ClientToServer.php
index 7c0919f636911342ed0e86765fc165de7fd1c6e6..48a5cfdec5aed3f5ccc23dcbf91769d216723357 100644 (file)
@@ -264,7 +264,7 @@ class ClientToServer
                $item['contact-id'] = $owner['id'];
                $item['author-id']  = $item['owner-id']  = Contact::getPublicIdByUserId($uid);
                $item['title']      = $object_data['name'];
-               $item['body']       = Markdown::toBBCode($object_data['content']);
+               $item['body']       = Markdown::toBBCode($object_data['content'] ?? '');
                $item['app']        = $application['name'] ?? 'API';
 
                if (!empty($object_data['target'][Receiver::TARGET_GLOBAL])) {
@@ -354,6 +354,10 @@ class ClientToServer
 
                $apcontact = APContact::getByURL($owner['url']);
 
+               if (empty($apcontact)) {
+                       throw new \Friendica\Network\HTTPException\NotFoundException();
+               }
+
                return self::getCollection($condition, DI::baseUrl() . '/outbox/' . $owner['nickname'], $page, $max_id, $uid, $apcontact['statuses_count']);
        }