all repos — honk @ 8da0e29a53a906cbf889bbd1a41ac96cd1deeb91

my fork of honk

more relaxed name check for honker
Ted Unangst tedu@tedunangst.com
Fri, 02 Apr 2021 19:59:01 -0400
commit

8da0e29a53a906cbf889bbd1a41ac96cd1deeb91

parent

6182a601a9d120d271fe2df8ed7384d14f342153

2 files changed, 4 insertions(+), 3 deletions(-)

jump to
M util.goutil.go

@@ -55,7 +55,7 @@ )

var savedassetparams = make(map[string]string) -var re_plainname = regexp.MustCompile("^[[:alnum:]]+$") +var re_plainname = regexp.MustCompile("^[[:alnum:]_-]+$") func getassetparam(file string) string { if p, ok := savedassetparams[file]; ok {
M web.goweb.go

@@ -1851,7 +1851,8 @@ combos := strings.TrimSpace(r.FormValue("combos"))

combos = " " + combos + " " honkerid, _ := strconv.ParseInt(r.FormValue("honkerid"), 10, 0) - if name != "" && !re_plainname.MatchString(name) { + re_namecheck := regexp.MustCompile("[[:alnum:]_.-]+") + if name != "" && !re_namecheck.MatchString(name) { http.Error(w, "please use a plainer name", http.StatusInternalServerError) return }

@@ -1897,7 +1898,7 @@

if url[0] == '#' { flavor = "peep" if name == "" { - name = url + name = url[1:] } _, err := stmtSaveHonker.Exec(u.UserID, name, url, flavor, combos, url, mj) if err != nil {