Merge pull request #9247 from annando/issue-9246

Issue 9246: Don't perform fulltext searches on URL
Dieser Commit ist enthalten in:
Hypolite Petovan 2020-09-20 11:19:23 -04:00 committet von GitHub
Commit bfd49ccacb
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
1 geänderte Dateien mit 8 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -132,6 +132,14 @@ class Index extends BaseSearch
}
}
// Don't perform a fulltext or tag search on search results that look like an URL
// Tags don't look like an URL and the fulltext search does only work with natural words
if (parse_url($search, PHP_URL_SCHEME) && parse_url($search, PHP_URL_HOST)) {
Logger::info('Skipping tag and fulltext search since the search looks like a URL.', ['q' => $search]);
notice(DI::l10n()->t('No results.'));
return $o;
}
$tag = $tag || DI::config()->get('system', 'only_tag_search');
// Here is the way permissions work in the search module...