]> git.mxchange.org Git - friendica.git/commitdiff
Exceptions
authorMichael <heluecht@pirati.ca>
Tue, 5 Nov 2019 22:13:33 +0000 (22:13 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 5 Nov 2019 22:13:33 +0000 (22:13 +0000)
src/Module/Starred.php

index dbda9f1076d4c4a68ba26c807d63f266bb41a3fa..74b75a42b0c7a21a58b706857132f4519092e12f 100644 (file)
@@ -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'];