]> git.mxchange.org Git - friendica.git/commitdiff
Exit with an error if profile info isn't available in Module\NoScrape
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 5 Jun 2020 18:28:11 +0000 (14:28 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Fri, 5 Jun 2020 18:28:11 +0000 (14:28 -0400)
src/Module/NoScrape.php

index 13a683d974868b53b9f18812de5d884df1d7840e..1457a1125f2f69101d062d4af54b2d3fc2e8a26e 100644 (file)
@@ -46,14 +46,17 @@ class NoScrape extends BaseModule
                        $which = $parameters['nick'];
                } elseif (local_user() && isset($parameters['profile']) && DI::args()->get(2) == 'view') {
                        // view infos about a known profile (needs a login)
-                       $which   = $a->user['nickname'];
+                       $which = $a->user['nickname'];
                } else {
                        System::jsonError(403, 'Authentication required');
-                       exit();
                }
 
                Profile::load($a, $which);
 
+               if (empty($a->profile['uid'])) {
+                       System::jsonError(404, 'Profile not found');
+               }
+
                $json_info = [
                        'addr'         => $a->profile['addr'],
                        'nick'         => $which,