From: Hypolite Petovan Date: Thu, 24 Nov 2022 04:26:23 +0000 (-0500) Subject: Reorder search to try redirecting to post first X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9de63501549f69ee3858ab116c2728ca07820d20;p=friendica.git Reorder search to try redirecting to post first - Pleroma's post page includes the author's feed which wrongly gets picked up as a contact - Address https://libranet.de/display/0b6b25a8-1563-7ec0-7408-70b986546395 --- diff --git a/src/Module/Search/Index.php b/src/Module/Search/Index.php index f4e1db6148..ec96b559a7 100644 --- a/src/Module/Search/Index.php +++ b/src/Module/Search/Index.php @@ -120,27 +120,27 @@ class Index extends BaseSearch if (strpos($search, '#') === 0) { $tag = true; $search = substr($search, 1); - } - - self::tryRedirectToProfile($search); - - if (strpos($search, '@') === 0 || strpos($search, '!') === 0) { - return self::performContactSearch($search); - } + } else { + if (strpos($search, '@') === 0 || strpos($search, '!') === 0) { + return self::performContactSearch($search); + } - self::tryRedirectToPost($search); - - if (!empty($_GET['search-option'])) { - switch ($_GET['search-option']) { - case 'fulltext': - break; - case 'tags': - $tag = true; - break; - case 'contacts': - return self::performContactSearch($search, '@'); - case 'forums': - return self::performContactSearch($search, '!'); + self::tryRedirectToPost($search); + + self::tryRedirectToProfile($search); + + if (!empty($_GET['search-option'])) { + switch ($_GET['search-option']) { + case 'fulltext': + break; + case 'tags': + $tag = true; + break; + case 'contacts': + return self::performContactSearch($search, '@'); + case 'forums': + return self::performContactSearch($search, '!'); + } } }