]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Starred.php
Added type hints
[friendica.git] / src / Module / Starred.php
index 74b75a42b0c7a21a58b706857132f4519092e12f..0f111b21e0198f51185aef8b650044d37837bd0d 100644 (file)
@@ -3,6 +3,7 @@
 namespace Friendica\Module;
 
 use Friendica\BaseModule;
+use Friendica\DI;
 use Friendica\Model\Item;
 
 /**
@@ -13,11 +14,11 @@ class Starred extends BaseModule
        public static function rawContent(array $parameters = [])
        {
                if (!local_user()) {
-                       throw new \Friendica\Network\HTTPException\NotFoundException();
+                       throw new \Friendica\Network\HTTPException\ForbiddenException();
                }
 
                if (empty($parameters['item'])) {
-                       throw new \Friendica\Network\HTTPException\NotFoundException();
+                       throw new \Friendica\Network\HTTPException\BadRequestException();
                }
 
                $itemId = intval($parameters['item']);
@@ -35,7 +36,7 @@ class Starred extends BaseModule
                $returnPath = $_REQUEST['return'] ?? '';
                if (!empty($returnPath)) {
                        $rand = '_=' . time() . (strpos($returnPath, '?') ? '&' : '?') . 'rand';
-                       self::getApp()->internalRedirect($returnPath . $rand);
+                       DI::baseUrl()->redirect($returnPath . $rand);
                }
 
                // the json doesn't really matter, it will either be 0 or 1