From 7adc3460b367d3f8c0299416d4f91873bb9e449a Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Nov 2019 22:13:33 +0000 Subject: [PATCH] Exceptions --- src/Module/Starred.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Module/Starred.php b/src/Module/Starred.php index dbda9f1076..74b75a42b0 100644 --- a/src/Module/Starred.php +++ b/src/Module/Starred.php @@ -13,18 +13,18 @@ class Starred extends BaseModule public static function rawContent(array $parameters = []) { if (!local_user()) { - exit(); + throw new \Friendica\Network\HTTPException\NotFoundException(); } if (empty($parameters['item'])) { - exit; - } else { - $itemId = intval($parameters['item']); + throw new \Friendica\Network\HTTPException\NotFoundException(); } + $itemId = intval($parameters['item']); + $item = Item::selectFirstForUser(local_user(), ['starred'], ['uid' => local_user(), 'id' => $itemId]); if (empty($item)) { - exit(); + throw new \Friendica\Network\HTTPException\NotFoundException(); } $starred = !(bool)$item['starred'];