Merge pull request #8024 from annando/fix-search

Fix: Search for terms and posts is now possible again
This commit is contained in:
Hypolite Petovan 2019-12-28 07:08:56 -05:00 committed by GitHub
commit ae0421f321
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -215,8 +215,8 @@ class Index extends BaseSearchModule
*/
private static function tryRedirectToProfile(BaseURL $baseURL, string $search)
{
$isUrl = parse_url($search, PHP_URL_SCHEME) !== '';
$isAddr = preg_match('/^@?([a-z0-9.-_]+@[a-z0-9.-_:]+)$/i', trim($search), $matches);
$isUrl = !empty(parse_url($search, PHP_URL_SCHEME));
$isAddr = (bool)preg_match('/^@?([a-z0-9.-_]+@[a-z0-9.-_:]+)$/i', trim($search), $matches);
if (!$isUrl && !$isAddr) {
return;