[MM-18036] Sanitize sql LIKE terms on search endpoints (#12044)
* Sanitize sql LIKE terms on search endpoints * Add search term sanitization in additional places
Этот коммит содержится в:
коммит произвёл
Daniel Schalla
родитель
8b969426f0
Коммит
814c234443
@@ -853,7 +853,7 @@ func (s *SqlGroupStore) groupsBySyncableBaseQuery(st model.GroupSyncableType, t
|
||||
}
|
||||
|
||||
if len(opts.Q) > 0 {
|
||||
pattern := fmt.Sprintf("%%%s%%", opts.Q)
|
||||
pattern := fmt.Sprintf("%%%s%%", sanitizeSearchTerm(opts.Q, "\\"))
|
||||
operatorKeyword := "ILIKE"
|
||||
if s.DriverName() == model.DATABASE_DRIVER_MYSQL {
|
||||
operatorKeyword = "LIKE"
|
||||
@@ -919,7 +919,7 @@ func (s *SqlGroupStore) GetGroups(page, perPage int, opts model.GroupSearchOpts)
|
||||
}
|
||||
|
||||
if len(opts.Q) > 0 {
|
||||
pattern := fmt.Sprintf("%%%s%%", opts.Q)
|
||||
pattern := fmt.Sprintf("%%%s%%", sanitizeSearchTerm(opts.Q, "\\"))
|
||||
operatorKeyword := "ILIKE"
|
||||
if s.DriverName() == model.DATABASE_DRIVER_MYSQL {
|
||||
operatorKeyword = "LIKE"
|
||||
|
||||
Ссылка в новой задаче
Block a user