From cd070954da050d356c8e32cf4d67cc3e337d19c9 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 17 Jan 2021 21:03:35 +0000 Subject: [PATCH] Don't ask for empty bodies --- include/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/api.php b/include/api.php index 13beab027..3d1afe01e 100644 --- a/include/api.php +++ b/include/api.php @@ -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)) { 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.