Escape backslashes in UserLookupGET

This commit is contained in:
Howl 2016-05-17 15:35:18 +02:00
parent f7559e8cc5
commit 32b9d1e2d5

View File

@ -291,6 +291,7 @@ func UserLookupGET(md common.MethodData) common.CodeMessager {
name := strings.NewReplacer( name := strings.NewReplacer(
"%", "\\%", "%", "\\%",
"_", "\\_", "_", "\\_",
"\\", "\\\\",
).Replace(md.C.Query("name")) ).Replace(md.C.Query("name"))
if name == "" { if name == "" {
return common.SimpleResponse(400, "please provide an username to start searching") return common.SimpleResponse(400, "please provide an username to start searching")