summaryrefslogtreecommitdiffstats
path: root/routers/web/explore/user.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-08-11 17:08:52 +0200
committerGitHub <noreply@github.com>2021-08-11 18:08:52 +0300
commitf1a810e0901b80eb6bc21103434fc0737af17eaa (patch)
tree9656d780cf19fd745f41eef0012701458aa271c4 /routers/web/explore/user.go
parent2d25b7d44bedf8f17cc2b49f39d1cee662b199a5 (diff)
downloadgitea-f1a810e0901b80eb6bc21103434fc0737af17eaa.tar.gz
gitea-f1a810e0901b80eb6bc21103434fc0737af17eaa.zip
Related refactors to ctx.FormX functions (#16567)
* use FormTrim if posible * speedup goGet * only convert if nessesary
Diffstat (limited to 'routers/web/explore/user.go')
-rw-r--r--routers/web/explore/user.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/routers/web/explore/user.go b/routers/web/explore/user.go
index 06dcdb3c6a..aeaaf92c12 100644
--- a/routers/web/explore/user.go
+++ b/routers/web/explore/user.go
@@ -7,7 +7,6 @@ package explore
import (
"bytes"
"net/http"
- "strings"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/base"
@@ -63,7 +62,7 @@ func RenderUserSearch(ctx *context.Context, opts *models.SearchUserOptions, tplN
orderBy = models.SearchOrderByAlphabetically
}
- opts.Keyword = strings.Trim(ctx.FormString("q"), " ")
+ opts.Keyword = ctx.FormTrim("q")
opts.OrderBy = orderBy
if len(opts.Keyword) == 0 || isKeywordValid(opts.Keyword) {
users, count, err = models.SearchUsers(opts)