diff --git a/app/Services/SearchApiV2Service.php b/app/Services/SearchApiV2Service.php index 58bac54ac..8103518af 100644 --- a/app/Services/SearchApiV2Service.php +++ b/app/Services/SearchApiV2Service.php @@ -236,11 +236,16 @@ class SearchApiV2Service return $this->resolveLocalProfile(); } } else { - if (! Helpers::validateUrl($query) && strpos($query, '@') == -1) { + if (! Helpers::validateUrl($query) && strpos($query, '@') === false) { return $default; } - if (! Str::startsWith($query, 'http') && Str::substrCount($query, '@') == 1 && strpos($query, '@') !== 0) { + if ( + ! Str::startsWith($query, 'http') && + Str::substrCount($query, '@') == 1 && + strpos($query, '@') !== false && + strpos($query, '@') !== 0 + ) { try { $res = WebfingerService::lookup('@'.$query, $mastodonMode); } catch (\Exception $e) {