X-Git-Url: https://iankelling.org/git/?p=iankelling.org;a=blobdiff_plain;f=_site%2Fcgi%2Fcomment;h=b84c45ebe6076132bf81a39b0cb1da5d3820eb00;hp=4b14c3c7c7bd9c3dfa9337a8494656913f662917;hb=a5d36b23813ae286ba3fb76e4f60ef6d267ba128;hpb=f32a9440b9055001ef3749999eaf3b4d7974932c diff --git a/_site/cgi/comment b/_site/cgi/comment index 4b14c3c..b84c45e 100755 --- a/_site/cgi/comment +++ b/_site/cgi/comment @@ -142,6 +142,10 @@ if COMMENT_TXT.length > 1000 or GOTO.length > 150 fail('length of comment or goto is too great') end +if COMMENT_TXT.length <= 2 or COMMENT_TXT =~ /\A\s*\Z/ + fail('not enough content in comment') +end + captchad = false if cgi.has_key?('answer') && cgi.has_key?('question') @@ -300,7 +304,7 @@ $db.execute('insert into c values (NULL, ?, ?, ?, ?, ?)', COMMENT_TXT]) if date - new_count = $db.execute(query + 'and date > ?',date) + new_count = $db.execute(query + 'and date > ?', date) else new_count = $db.execute(query) end @@ -328,7 +332,7 @@ END_OF_MESSAGE smtp.send_message msg, opts[:from], opts[:to] end end - send_email :subject => 'new comments on iankelling.org' + send_email :subject => "new comment on #{DN}" end post(md_file)