fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-07-29 08:20 am

[dw-free] When captcha is disabled for a page, the form cannot be submitted.

[commit: http://hg.dwscoalition.org/dw-free/rev/a7aa86b62ca8]

http://bugs.dwscoalition.org/show_bug.cgi?id=2919

Captcha result is always valid, if it's disabled on the page (allows the
form submission to go through)

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/DW/Captcha.pm
--------------------------------------------------------------------------------
diff -r 2870a0a553f5 -r a7aa86b62ca8 cgi-bin/DW/Captcha.pm
--- a/cgi-bin/DW/Captcha.pm	Thu Jul 29 08:07:28 2010 +0000
+++ b/cgi-bin/DW/Captcha.pm	Thu Jul 29 01:20:07 2010 -0700
@@ -86,7 +86,9 @@ sub print {
 
 sub validate { 
     my ( $self, %opts ) = @_;
-    return unless $self->enabled;
+
+    # if disabled, then it's always valid to allow the post to go through
+    return 1 unless $self->enabled;
 
     $self->init_opts( %opts );
 
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org