Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Cette révision appartient à :
akuma06 2017-05-08 13:18:52 +02:00
Parent 82c5767ac4
révision 97efa46a29

Voir le fichier

@ -38,7 +38,7 @@ func PostCommentHandler(w http.ResponseWriter, r *http.Request) {
if !captcha.Authenticate(userCaptcha) {
http.Error(w, "bad captcha", 403)
}
currentUser := GetUser()
currentUser := GetUser(r)
content := p.Sanitize(r.FormValue("comment"))
idNum, err := strconv.Atoi(id)
@ -46,7 +46,7 @@ func PostCommentHandler(w http.ResponseWriter, r *http.Request) {
userId := 0
if (currentUser.Id > 0) {
username = currentUser.Username
userId = currentUser.Id
userId = int(currentUser.Id)
}
comment := model.Comment{Username: username, UserId: userId, Content: content, TorrentId: idNum}
db.ORM.Create(&comment)