From 1304e145726232376b8f4b7d0a8780e15cbfeb45 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 5 Jun 2020 14:28:11 -0400 Subject: [PATCH] Exit with an error if profile info isn't available in Module\NoScrape --- src/Module/NoScrape.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Module/NoScrape.php b/src/Module/NoScrape.php index 13a683d974..1457a1125f 100644 --- a/src/Module/NoScrape.php +++ b/src/Module/NoScrape.php @@ -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,