mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 03:58:28 +02:00
fix: trim the whitespaces for the search keyword (#893)
This commit is contained in:
1 parent
55f2059f71
commit
3576e1ee73
7 files changed
+14
-11
No files matched your search
@@ -40,7 +40,7 @@ func GetNotificationCount(c *context.Context) {
|
||||
// Notifications is the notifications page
|
||||
func Notifications(c *context.Context) {
|
||||
var (
|
||||
keyword = c.Query("q")
|
||||
keyword = strings.Trim(c.Query("q"), " ")
|
||||
status models.NotificationStatus
|
||||
page = c.QueryInt("page")
|
||||
perPage = c.QueryInt("perPage")
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user