From 5320c62e1777b4acf68f83f2d0576e5010da4643 Mon Sep 17 00:00:00 2001 From: Howl Date: Tue, 17 May 2016 17:40:30 +0200 Subject: [PATCH] Be more permissive in UserLookupGET (wildcard both at start and at end of username) --- app/v1/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/v1/user.go b/app/v1/user.go index 491bec5..8432350 100644 --- a/app/v1/user.go +++ b/app/v1/user.go @@ -301,7 +301,7 @@ func UserLookupGET(md common.MethodData) common.CodeMessager { if name == "" { return common.SimpleResponse(400, "please provide an username to start searching") } - name += "%" + name = "%" + name + "%" rows, err := md.DB.Query("SELECT users.id, users.username FROM users WHERE username LIKE ? AND allowed = '1' LIMIT 25", name) if err != nil { md.Err(err)