From 3576e1ee739cc03f87e6ce98dbef2f32b517b202 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 11 Feb 2017 12:00:01 +0800 Subject: fix: trim the whitespaces for the search keyword (#893) --- routers/user/profile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routers/user/profile.go') diff --git a/routers/user/profile.go b/routers/user/profile.go index cca4391a70..f0b1be3060 100644 --- a/routers/user/profile.go +++ b/routers/user/profile.go @@ -155,7 +155,7 @@ func Profile(ctx *context.Context) { ctx.Data["SortType"] = "recentupdate" } - keyword := ctx.Query("q") + keyword := strings.Trim(ctx.Query("q"), " ") ctx.Data["Keyword"] = keyword if len(keyword) == 0 { var total int -- cgit v1.2.3