Issue 11891: Enable search for user@domain.tld
This commit is contained in:
parent
38cf0666bd
commit
4b8c631216
|
@ -64,7 +64,7 @@ class BaseSearch extends BaseModule
|
||||||
$header = '';
|
$header = '';
|
||||||
|
|
||||||
if (strpos($search, '@') === 0) {
|
if (strpos($search, '@') === 0) {
|
||||||
$search = substr($search, 1);
|
$search = trim(substr($search, 1));
|
||||||
$type = Search::TYPE_PEOPLE;
|
$type = Search::TYPE_PEOPLE;
|
||||||
$header = DI::l10n()->t('People Search - %s', $search);
|
$header = DI::l10n()->t('People Search - %s', $search);
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ class BaseSearch extends BaseModule
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($search, '!') === 0) {
|
if (strpos($search, '!') === 0) {
|
||||||
$search = substr($search, 1);
|
$search = trim(substr($search, 1));
|
||||||
$type = Search::TYPE_FORUM;
|
$type = Search::TYPE_FORUM;
|
||||||
$header = DI::l10n()->t('Forum Search - %s', $search);
|
$header = DI::l10n()->t('Forum Search - %s', $search);
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,8 +246,10 @@ class Contact extends BaseModule
|
||||||
if ($search) {
|
if ($search) {
|
||||||
$searching = true;
|
$searching = true;
|
||||||
$search_hdr = $search;
|
$search_hdr = $search;
|
||||||
$search_txt = preg_quote($search);
|
$search_txt = preg_quote(trim($search, ' @!'));
|
||||||
$sql_extra .= " AND (name REGEXP ? OR url REGEXP ? OR nick REGEXP ?)";
|
$sql_extra .= " AND (`name` REGEXP ? OR `url` REGEXP ? OR `nick` REGEXP ? OR `addr` REGEXP ? OR `alias` REGEXP ?)";
|
||||||
|
$sql_values[] = $search_txt;
|
||||||
|
$sql_values[] = $search_txt;
|
||||||
$sql_values[] = $search_txt;
|
$sql_values[] = $search_txt;
|
||||||
$sql_values[] = $search_txt;
|
$sql_values[] = $search_txt;
|
||||||
$sql_values[] = $search_txt;
|
$sql_values[] = $search_txt;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user