Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fix missing error enforcement on comments and reports

Cette révision appartient à :
sfan5 2017-05-11 15:14:48 +02:00
Parent fd94746eed
révision 8e2c643a34

Voir le fichier

@ -41,11 +41,13 @@ func PostCommentHandler(w http.ResponseWriter, r *http.Request) {
if strings.TrimSpace(r.FormValue("comment")) == "" {
http.Error(w, "comment empty", 406)
return
}
userCaptcha := captcha.Extract(r)
if !captcha.Authenticate(userCaptcha) {
http.Error(w, "bad captcha", 403)
return
}
currentUser := GetUser(r)
content := p.Sanitize(r.FormValue("comment"))
@ -76,6 +78,7 @@ func ReportTorrentHandler(w http.ResponseWriter, r *http.Request) {
userCaptcha := captcha.Extract(r)
if !captcha.Authenticate(userCaptcha) {
http.Error(w, "bad captcha", 403)
return
}
currentUser := GetUser(r)