Update SearchApiV2Service

pull/6522/head
Daniel Supernault 6 months ago
parent ef803ae9b6
commit 9d60db5a63
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1

@ -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) {

Loading…
Cancel
Save