]> git.mxchange.org Git - friendica.git/commitdiff
Avoid returning of the actor when requesting friendica/json
authorMichael <heluecht@pirati.ca>
Mon, 28 Mar 2022 13:12:45 +0000 (13:12 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 28 Mar 2022 13:12:45 +0000 (13:12 +0000)
src/Module/Friendica.php

index 87edf14ca8c2be358dc0bf83d813a3a04a55daee..3fccda5f859ddd429adb34a8e21e23e3c521ca83 100644 (file)
@@ -112,7 +112,12 @@ class Friendica extends BaseModule
 
        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: *');
@@ -123,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 = [