mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Related refactors to ctx.FormX functions (#16567)
* use FormTrim if posible * speedup goGet * only convert if nessesary
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user