]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Friendica.php
head fixings
[friendica.git] / src / Module / Friendica.php
index 08e463bd409587e2b334540d1895f6bedb64dfab..3fccda5f859ddd429adb34a8e21e23e3c521ca83 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -30,7 +30,6 @@ use Friendica\Database\PostUpdate;
 use Friendica\DI;
 use Friendica\Model\User;
 use Friendica\Network\HTTPException;
-use Friendica\Network\HTTPException\ImATeapotException;
 use Friendica\Protocol\ActivityPub;
 
 /**
@@ -39,7 +38,7 @@ use Friendica\Protocol\ActivityPub;
  */
 class Friendica extends BaseModule
 {
-       public static function content(array $parameters = [])
+       protected function content(array $request = []): string
        {
                $config = DI::config();
 
@@ -111,9 +110,14 @@ class Friendica extends BaseModule
                ]);
        }
 
-       public static function rawContent(array $parameters = [])
+       protected function rawContent(array $request = [])
        {
-               if (ActivityPub::isRequest()) {
+               // @TODO: Replace with parameter from router
+               if (DI::args()->getArgc() <= 1 || (DI::args()->getArgv()[1] !== 'json')) {
+                       if (!ActivityPub::isRequest()) {
+                               return;
+                       }
+
                        try {
                                $data = ActivityPub\Transmitter::getProfile(0);
                                header('Access-Control-Allow-Origin: *');
@@ -124,11 +128,6 @@ class Friendica extends BaseModule
                        }
                }
 
-               // @TODO: Replace with parameter from router
-               if (DI::args()->getArgc() <= 1 || (DI::args()->getArgv()[1] !== 'json')) {
-                       return;
-               }
-
                $config = DI::config();
 
                $register_policies = [