git » blitiri » commit 464df08

Store the sanitized form data when commenting online

author Leandro Lucarella
2008-08-13 21:15:38 UTC
committer Leandro Lucarella
2008-08-25 17:41:51 UTC
parent 3712946cab71832c15f0ae185b9605d1f1cc6367

Store the sanitized form data when commenting online

When storing a comment, we should use the validated data instead of
the raw one.

blitiri.cgi +2 -1

diff --git a/blitiri.cgi b/blitiri.cgi
index 1ae70ff..e69789f 100755
--- a/blitiri.cgi
+++ b/blitiri.cgi
@@ -1139,7 +1139,8 @@ def handle_cgi():
 						% (line, desc)
 				valid = False
 		if valid:
-			c = article.add_comment(author, body, link)
+			c = article.add_comment(form_data.author,
+					form_data.body, form_data.link)
 			c.save()
 			cdb = CommentDB(article)
 			cdb.comments = article.comments