summaryrefslogtreecommitdiffstats
path: root/store/sql_user_store.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-11-21 12:17:53 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2016-11-21 12:17:53 -0500
commit062f758e47cda90a9ae783cbaee6bf3bec571178 (patch)
tree8d8fe056ee50d325c3e465529f7a4a34b3a8051b /store/sql_user_store.go
parenta9824a3653a30779f7fd0cc62e329c988f02b519 (diff)
downloadchat-062f758e47cda90a9ae783cbaee6bf3bec571178.tar.gz
chat-062f758e47cda90a9ae783cbaee6bf3bec571178.tar.bz2
chat-062f758e47cda90a9ae783cbaee6bf3bec571178.zip
Fix user search when using an asterisk (#4586)
Diffstat (limited to 'store/sql_user_store.go')
-rw-r--r--store/sql_user_store.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/store/sql_user_store.go b/store/sql_user_store.go
index aa3bb4380..1a38e89e8 100644
--- a/store/sql_user_store.go
+++ b/store/sql_user_store.go
@@ -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)
}