When using ajax_comments with CAPTCHA enabled, entering incorrect captcha code breaks ‘Post new comment’ form. Captcha image is not being refreshed after submission and all further attempts to add new comment without refreshing the page fail with error "CAPTCHA session reuse attack detected"

To be able to successfully add new comment after a failed attempt, user has to refresh the page and enter their comment along with the new captcha code once again.

CommentFileSizeAuthor
#1 ajax_comments-1206130.patch1.67 KBdan.nsk

Comments

dan.nsk’s picture

Title: Captcha image is not being refreshed after failed comment submission when using ajax_comments » Captcha image is not being refreshed after a failed comment submission when using ajax_comments
Status: Active » Needs review
StatusFileSize
new1.67 KB

Here is a quick fix

ilyaos-1’s picture

Many thanks for this patch! I tried to use it and tried some bugs:

1.@@ -104,7 +108,7 @@
'data' => $comment_form . $output, in different order you can't see the error messages

2, If you use preview before post the comment, CAPTCHA don't refresh. So you will see error message even if you type it correctly.

ilyaos-1’s picture

Some more details. If you add this line (as mentioned in the patch file) AJAX Comments stop working in IE9 (comments form will be locked).

+ 'data' => $output . $comment_form,

Any ideas how to solve this?

qzmenko’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Issue is closed because 6.x version is unsupported. Feel free to open new issue for 7.x or 8.x versions of module.