mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-04-01 03:53 am

[dw-free] Verify that bad-password checking is implemented & enabled

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

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

Fix some bugs in bad password checking.

Patch by [personal profile] janinedog.

Files modified:
  • cgi-bin/LJ/CreatePage.pm
--------------------------------------------------------------------------------
diff -r 9fbd871d8aeb -r 51008c0d151e cgi-bin/LJ/CreatePage.pm
--- a/cgi-bin/LJ/CreatePage.pm	Wed Apr 01 03:50:07 2009 +0000
+++ b/cgi-bin/LJ/CreatePage.pm	Wed Apr 01 03:53:11 2009 +0000
@@ -81,10 +81,10 @@ sub verify_password {
         $name = $u->name_raw;
     }
 
-    $password = $opts{password};
-    $username = $opts{username};
-    $email = $opts{email};
-    $name = $opts{name};
+    $password = $opts{password} if $opts{password};
+    $username = $opts{username} if $opts{username};
+    $email = $opts{email} if $opts{email};
+    $name = $opts{name} if $opts{name};
 
     # password must exist
     return LJ::Widget::CreateAccount->ml( 'widget.createaccount.error.password.blank' )
@@ -124,7 +124,7 @@ sub verify_password {
     # at least 4 unique characters
     my %unique_chars = map { $_ => 1 } split( //, $password );
     return LJ::Widget::CreateAccount->ml( 'widget.createaccount.error.password.needsmoreuniquechars' )
-        unless scalar keys %unique_chars > 4;
+        unless scalar keys %unique_chars >= 4;
 
     # contains at least one digit or symbol
     return LJ::Widget::CreateAccount->ml( 'widget.createaccount.error.password.needsnonletter' )
--------------------------------------------------------------------------------

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