Merge pull request #747 from sydnash/sydnash-patch-1

.只能匹配任意字符一次
This commit is contained in:
astaxie
2016-12-17 04:37:35 +08:00
committed by GitHub

View File

@@ -59,7 +59,7 @@
r.ParseForm()
username := r.Form.Get("username")
CleanMap := make(map[string]interface{}, 0)
if ok, _ := regexp.MatchString("^[a-zA-Z0-9].$", username); ok {
if ok, _ := regexp.MatchString("^[a-zA-Z0-9]+$", username); ok {
CleanMap["username"] = username
}