From: jocuri%softhome.net <> Date: Wed, 3 Mar 2004 13:19:28 +0000 (+0000) Subject: Patch for bug 123077; improve the ValidatePassword sub so that a password change... X-Git-Tag: bugzilla-2.17.7~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=261e207c1170cf374467cc422bd76a861110b8ab;p=thirdparty%2Fbugzilla.git Patch for bug 123077; improve the ValidatePassword sub so that a password change is no longer accepted with a blank second field; r=kiko, a=justdave. --- diff --git a/globals.pl b/globals.pl index 9c1b9a7ef4..91fd055545 100644 --- a/globals.pl +++ b/globals.pl @@ -706,7 +706,7 @@ sub ValidatePassword { ThrowUserError("password_too_short"); } elsif (length($password) > 16) { ThrowUserError("password_too_long"); - } elsif ($matchpassword && $password ne $matchpassword) { + } elsif ((defined $matchpassword) && ($password ne $matchpassword)) { ThrowUserError("passwords_dont_match"); } } diff --git a/userprefs.cgi b/userprefs.cgi index 017c7c94d1..9a1a937172 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -97,9 +97,8 @@ sub SaveAccount { if ($pwd1 ne "" || $pwd2 ne "") { - ($pwd1 eq $pwd2) || ThrowUserError("passwords_dont_match"); $::FORM{'new_password1'} || ThrowUserError("new_password_missing"); - ValidatePassword($pwd1); + ValidatePassword($pwd1, $pwd2); my $cryptedpassword = SqlQuote(Crypt($pwd1)); SendSQL("UPDATE profiles