Fix user search when using an asterisk (#4586)

Этот коммит содержится в:
Joram Wilander
2016-11-21 12:17:53 -05:00
коммит произвёл Harrison Healey
родитель a9824a3653
Коммит 062f758e47
2 изменённых файлов: 40 добавлений и 1 удалений

Просмотреть файл

@@ -1217,11 +1217,24 @@ func (us SqlUserStore) SearchInChannel(channelId string, term string, options ma
return storeChannel
}
var specialUserSearchChar = []string{
"<",
">",
"+",
"-",
"(",
")",
"~",
"@",
":",
"*",
}
func (us SqlUserStore) performSearch(searchQuery string, term string, options map[string]bool, parameters map[string]interface{}) StoreResult {
result := StoreResult{}
// these chars have special meaning and can be treated as spaces
for _, c := range specialSearchChar {
for _, c := range specialUserSearchChar {
term = strings.Replace(term, c, " ", -1)
}