MM-46503: Escape incorrect pg user search query (#20863)
There were 2 main problems after https://github.com/mattermost/mattermost-server/pull/20367. 1. The : wasn't escaped. 2. Empty search didn't work. For 1, we escape the ':'. For 2, we just use pattern search. ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
efbcb0a35a
Коммит
8fd1762c3b
@@ -2800,6 +2800,22 @@ func testUserStoreSearch(t *testing.T, ss store.Store) {
|
||||
},
|
||||
[]*model.User{u3},
|
||||
},
|
||||
{
|
||||
"escape :",
|
||||
t1id,
|
||||
"ji:m",
|
||||
&model.UserSearchOptions{},
|
||||
[]*model.User{},
|
||||
},
|
||||
{
|
||||
"wildcard search",
|
||||
t1id,
|
||||
"@",
|
||||
&model.UserSearchOptions{
|
||||
Limit: model.UserSearchDefaultLimit,
|
||||
},
|
||||
[]*model.User{u2, u1, u3},
|
||||
},
|
||||
}
|
||||
|
||||
for _, testCase := range testCases {
|
||||
|
||||
Ссылка в новой задаче
Block a user