]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
Fix the test data
[friendica.git] / include / api.php
index 13beab027ba8307628b32112091714bee05f8286..4aa4b21e29199e4a0c339cb884d94b251f2062fd 100644 (file)
@@ -2043,7 +2043,7 @@ function api_statuses_repeat($type)
        $fields = ['uri-id', 'network', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink'];
        $item = Post::selectFirst($fields, ['id' => $id, 'private' => [Item::PUBLIC, Item::UNLISTED]]);
  
-       if (!empty($item['body'])) {
+       if (DBA::isResult($item) && !empty($item['body'])) {
                if (in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::TWITTER])) {
                        if (!Item::performActivity($id, 'announce', local_user())) {
                                throw new InternalServerErrorException();
@@ -2075,7 +2075,7 @@ function api_statuses_repeat($type)
                        $item_id = item_post($a);
                }
        } else {
-               throw new ForbiddenException(!DBA::isResult($item) ? 'not found' : 'empty body');
+               throw new ForbiddenException();
        }
 
        // output the post that we just posted.