Browse Source

#1401

fix bug
tags/v1.22.1.3
chenyifan01 3 years ago
parent
commit
24d1c81463
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      routers/repo/repo.go

+ 2
- 1
routers/repo/repo.go View File

@@ -13,6 +13,7 @@ import (
"path"
"regexp"
"strings"
"unicode/utf8"

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/auth"
@@ -566,7 +567,7 @@ func CheckName(ctx *context.Context) {
var r = make(map[string]string, 1)
q := ctx.Query("q")
owner := ctx.Query("owner")
if q == "" || owner == "" || len(q) > 100 || !validation.ValidAlphaDashDotChinese(q) {
if q == "" || owner == "" || utf8.RuneCountInString(q) > 100 || !validation.ValidAlphaDashDotChinese(q) {
r["name"] = ""
ctx.JSON(200, r)
return


Loading…
Cancel
Save