Exceptions

This commit is contained in:
Michael 2019-11-05 22:13:33 +00:00
parent a5b5f0e455
commit 7adc3460b3

View file

@ -13,18 +13,18 @@ class Starred extends BaseModule
public static function rawContent(array $parameters = []) public static function rawContent(array $parameters = [])
{ {
if (!local_user()) { if (!local_user()) {
exit(); throw new \Friendica\Network\HTTPException\NotFoundException();
} }
if (empty($parameters['item'])) { if (empty($parameters['item'])) {
exit; throw new \Friendica\Network\HTTPException\NotFoundException();
} else {
$itemId = intval($parameters['item']);
} }
$itemId = intval($parameters['item']);
$item = Item::selectFirstForUser(local_user(), ['starred'], ['uid' => local_user(), 'id' => $itemId]); $item = Item::selectFirstForUser(local_user(), ['starred'], ['uid' => local_user(), 'id' => $itemId]);
if (empty($item)) { if (empty($item)) {
exit(); throw new \Friendica\Network\HTTPException\NotFoundException();
} }
$starred = !(bool)$item['starred']; $starred = !(bool)$item['starred'];