replace \r sooner

This commit is contained in:
Ted Unangst 2020-01-06 12:33:48 -05:00
parent 002ddf12a5
commit 07615e9822
1 changed files with 2 additions and 1 deletions

3
web.go
View File

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