$header = '';
if (strpos($search, '@') === 0) {
- $search = substr($search, 1);
+ $search = trim(substr($search, 1));
$type = Search::TYPE_PEOPLE;
$header = DI::l10n()->t('People Search - %s', $search);
}
if (strpos($search, '!') === 0) {
- $search = substr($search, 1);
+ $search = trim(substr($search, 1));
$type = Search::TYPE_FORUM;
$header = DI::l10n()->t('Forum Search - %s', $search);
}
if ($search) {
$searching = true;
$search_hdr = $search;
- $search_txt = preg_quote($search);
- $sql_extra .= " AND (name REGEXP ? OR url REGEXP ? OR nick REGEXP ?)";
+ $search_txt = preg_quote(trim($search, ' @!'));
+ $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;