]> git.mxchange.org Git - friendica.git/commitdiff
Use parameters
authornupplaPhil <admin@philipp.info>
Sun, 26 Jan 2020 22:53:49 +0000 (23:53 +0100)
committernupplaPhil <admin@philipp.info>
Sun, 26 Jan 2020 22:53:49 +0000 (23:53 +0100)
src/Module/NoScrape.php

index 26cae9817daf57806688138085f95d9cbdd179ed..984ed9d608097604dc549c4b529918f9044946f5 100644 (file)
@@ -22,12 +22,17 @@ class NoScrape extends BaseModule
        {
                $a = DI::app();
 
-               $which = DI::args()->get(1);
-
-               $profile = 0;
-               if ((local_user()) && (DI::args()->get(2) === 'view')) {
+               if (isset($parameters['nick'])) {
+                       // Get infos about a specific nick (public)
+                       $which = $parameters['nick'];
+                       $profile = 0;
+               } elseif (local_user() && isset($parameters['profile']) && DI::args()->get(2) == 'view') {
+                       // view infos about a known profile (needs a login)
                        $which   = $a->user['nickname'];
-                       $profile = DI::args()->get(1);
+                       $profile = $parameters['profile'];
+               } else {
+                       System::jsonError(404, 'Invalid request');
+                       exit();
                }
 
                Profile::load($a, $which, $profile);