diff options
author | FChannel <=> | 2021-01-28 15:17:22 -0800 |
---|---|---|
committer | FChannel <=> | 2021-01-28 15:17:22 -0800 |
commit | 7985199b37c4e497bb9b245613d3eeb09c98cadb (patch) | |
tree | 5ddf70177dcb5c56fa34409cf3806eaa699ef5a9 /main.go | |
parent | 6dc1c48518a4f458412347ca5c73eb7846229a0d (diff) |
max length for input fields
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -287,8 +287,8 @@ func main() { return } - if(len(r.FormValue("subject")) > 100 || len(r.FormValue("name")) > 100) { - w.Write([]byte("Name or Subject limit 100 characters")) + if(len(r.FormValue("subject")) > 100 || len(r.FormValue("name")) > 100 || len(r.FormValue("options" > 100) { + w.Write([]byte("Name, Subject or Options limit 100 characters")) return } @@ -756,6 +756,11 @@ func main() { var captcha = r.FormValue("captchaCode") + ":" + r.FormValue("captcha") + if len(reason) > 100 { + w.Write([]byte("Report comment limit 100 characters")) + return + } + if(!CheckCaptcha(db, captcha)) { w.WriteHeader(http.StatusBadRequest) w.Write([]byte("captcha required")) |