Add some more escapes to the query sanitizer
Signed-off-by: Tom Hughes <tom@compton.nu>
This commit is contained in:
parent
d01184f28d
commit
099d3ddb6f
|
@ -50,7 +50,12 @@ func sanitizeQuery(q string) string {
|
|||
q = strings.Join(strings.Fields(q), " ")
|
||||
q = strings.Replace(q, "(", "\\(", -1)
|
||||
q = strings.Replace(q, ")", "\\)", -1)
|
||||
q = strings.Replace(q, "[", "\\[", -1)
|
||||
q = strings.Replace(q, "]", "\\]", -1)
|
||||
q = strings.Replace(q, "{", "\\{", -1)
|
||||
q = strings.Replace(q, "}", "\\}", -1)
|
||||
q = strings.Replace(q, "*", "\\*", -1)
|
||||
q = strings.Replace(q, "^", "\\^", -1)
|
||||
q = strings.Replace(q, "$", "\\$", -1)
|
||||
return q
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue