]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Like.php
Update doignore() in main.js to match new Item\Ignore return type
[friendica.git] / src / Module / Like.php
index f57cbadfd357516abe30977c63f3d6faf4a74484..1c98cbc38c6ba6ef0a4c8c0c2df043694f7d3a14 100644 (file)
@@ -4,6 +4,7 @@ namespace Friendica\Module;
 
 use Friendica\BaseModule;
 use Friendica\Model\Item;
+use Friendica\Core\Session;
 use Friendica\Network\HTTPException;
 use Friendica\Util\Strings;
 
@@ -12,9 +13,9 @@ use Friendica\Util\Strings;
  */
 class Like extends BaseModule
 {
-       public static function rawContent()
+       public static function rawContent(array $parameters = [])
        {
-               if (!local_user() && !remote_user()) {
+               if (!Session::isAuthenticated()) {
                        throw new HTTPException\ForbiddenException();
                }
 
@@ -35,7 +36,7 @@ class Like extends BaseModule
 
                // Decide how to return. If we were called with a 'return' argument,
                // then redirect back to the calling page. If not, just quietly end
-               $returnPath = defaults($_REQUEST, 'return', '');
+               $returnPath = $_REQUEST['return'] ?? '';
 
                if (!empty($returnPath)) {
                        $rand = '_=' . time();