Commit d455b10d authored by Simon Green's avatar Simon Green

Bug 897264 - letters_numbers_specialchars password restriction is incorrect

r=LpSolit, a=sgreen
parent 3bd72b44
......@@ -2096,7 +2096,7 @@ sub validate_password {
my $complexity_level = Bugzilla->params->{password_complexity};
if ($complexity_level eq 'letters_numbers_specialchars') {
ThrowUserError('password_not_complex')
if ($password !~ /\w/ || $password !~ /\d/ || $password !~ /[[:punct:]]/);
if ($password !~ /[[:alpha:]]/ || $password !~ /\d/ || $password !~ /[[:punct:]]/);
} elsif ($complexity_level eq 'letters_numbers') {
ThrowUserError('password_not_complex')
if ($password !~ /[[:lower:]]/ || $password !~ /[[:upper:]]/ || $password !~ /\d/);
......
......@@ -1385,16 +1385,16 @@
[% passregex = Param('password_complexity') %]
The password must contain at least one:
<ul>
[% IF passregex.search('letters') %]
[% IF passregex == 'letters_numbers_specialchars' %]
<li>letter</li>
<li>special character</li>
[% ELSIF passregex.search('letters') %]
<li>UPPERCASE letter</li>
<li>lowercase letter</li>
[% END %]
[% IF passregex.search('numbers') %]
<li>digit</li>
[% END %]
[% IF passregex.search('specialchars') %]
<li>special character</li>
[% END %]
</ul>
[% ELSIF error == "product_access_denied" %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment