From f3d98b2864f131d6ba6532f81c61fa3d9895bd20 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 10 Apr 2018 10:46:10 +0200 Subject: [PATCH] api_get_user() should not return false right away if the number in the URL is not a valid user --- include/api.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/include/api.php b/include/api.php index 645d82a461..ffe193ab9e 100644 --- a/include/api.php +++ b/include/api.php @@ -577,14 +577,12 @@ function api_get_user(App $a, $contact_id = null) if (is_numeric($user)) { $user = dbesc(api_unique_id_to_nurl(intval($user))); - if ($user == "") { - return false; - } - - $url = $user; - $extra_query = "AND `contact`.`nurl` = '%s' "; - if (api_user() !== false) { - $extra_query .= "AND `contact`.`uid`=" . intval(api_user()); + if ($user != "") { + $url = $user; + $extra_query = "AND `contact`.`nurl` = '%s' "; + if (api_user() !== false) { + $extra_query .= "AND `contact`.`uid`=" . intval(api_user()); + } } } else { $user = dbesc($user);