From 7985199b37c4e497bb9b245613d3eeb09c98cadb Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Thu, 28 Jan 2021 15:17:22 -0800 Subject: max length for input fields --- main.go | 9 +++++++-- static/bottom.html | 4 ++-- static/top.html | 8 ++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/main.go b/main.go index f6ed5f0..0ff2854 100644 --- a/main.go +++ b/main.go @@ -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")) diff --git a/static/bottom.html b/static/bottom.html index 25339b5..c058b14 100644 --- a/static/bottom.html +++ b/static/bottom.html @@ -2,8 +2,8 @@