From 5a36c6b6c002d1d6eb5a79348f09f142250f3cd3 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 17 Jan 2021 20:56:15 +0000 Subject: [PATCH] Test for failed tests --- include/api.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/api.php b/include/api.php index 9a1767d6ed..13beab027b 100644 --- a/include/api.php +++ b/include/api.php @@ -2041,9 +2041,9 @@ function api_statuses_repeat($type) Logger::log('API: api_statuses_repeat: '.$id); $fields = ['uri-id', 'network', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink']; - $item = Item::selectFirst($fields, ['id' => $id, 'private' => [Item::PUBLIC, Item::UNLISTED]]); - - if (DBA::isResult($item) && $item['body'] != "") { + $item = Post::selectFirst($fields, ['id' => $id, 'private' => [Item::PUBLIC, Item::UNLISTED]]); + + if (!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(); + throw new ForbiddenException(!DBA::isResult($item) ? 'not found' : 'empty body'); } // output the post that we just posted.