From 07615e9822c292b5cd7b383a41cd310edfe4249e Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Mon, 6 Jan 2020 12:33:48 -0500 Subject: [PATCH] replace \r sooner --- web.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web.go b/web.go index 276df13..67bc6cb 100644 --- a/web.go +++ b/web.go @@ -1108,6 +1108,7 @@ func honkpage(w http.ResponseWriter, u *login.UserInfo, honks []*Honk, templinfo func saveuser(w http.ResponseWriter, r *http.Request) { whatabout := r.FormValue("whatabout") + whatabout = strings.Replace(whatabout, "\r", "", -1) u := login.GetUserInfo(r) user, _ := butwhatabout(u.Username) db := opendatabase() @@ -1132,7 +1133,7 @@ func saveuser(w http.ResponseWriter, r *http.Request) { } else { options.Avatar = "" } - whatabout = strings.Replace(strings.TrimSpace(whatabout), "\r", "", -1) + whatabout = strings.TrimSpace(whatabout) j, err := jsonify(options) if err == nil { _, err = db.Exec("update users set about = ?, options = ? where username = ?", whatabout, j, u.Username)