|
|
|
@@ -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 |
|
|
|
|