namecheck regexp should match whole string

This commit is contained in:
Ted Unangst 2023-02-26 12:08:43 -05:00
parent 5e481273df
commit e8d1d64f1c
1 changed files with 1 additions and 1 deletions

2
web.go
View File

@ -1904,7 +1904,7 @@ func submithonker(w http.ResponseWriter, r *http.Request) *Honker {
combos = " " + combos + " "
honkerid, _ := strconv.ParseInt(r.FormValue("honkerid"), 10, 0)
re_namecheck := regexp.MustCompile("[\\pL[:digit:]_.-]+")
re_namecheck := regexp.MustCompile("^[\\pL[:digit:]_.-]+$")
if name != "" && !re_namecheck.MatchString(name) {
http.Error(w, "please use a plainer name", http.StatusInternalServerError)
return nil