aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2011-03-25 22:48:44 +0100
committerAndreas Fischer <bantu@phpbb.com>2011-04-01 15:10:29 +0200
commitdba8cf12fd2573edc9722076770140c7b4024f6b (patch)
tree5c6d7022dede43bc49ba8a34b301f50cc0ee098d /phpBB/includes
parenta83518982394f93e843e68f663fd39b2d6fd5150 (diff)
downloadforums-dba8cf12fd2573edc9722076770140c7b4024f6b.tar
forums-dba8cf12fd2573edc9722076770140c7b4024f6b.tar.gz
forums-dba8cf12fd2573edc9722076770140c7b4024f6b.tar.bz2
forums-dba8cf12fd2573edc9722076770140c7b4024f6b.tar.xz
forums-dba8cf12fd2573edc9722076770140c7b4024f6b.zip
[ticket/9751] Use a switch/case block without break for password complexity.
PHPBB3-9751
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions_user.php24
1 files changed, 13 insertions, 11 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 88e07f729c..c51e571e31 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -1643,23 +1643,25 @@ function validate_password($password)
switch ($config['pass_complex'])
{
- case 'PASS_TYPE_CASE':
- $chars[] = $low;
- $chars[] = $upp;
- break;
+ // No break statements below ...
+ // We require strong passwords in case pass_complex is not set or is invalid
+ default:
+ // Require mixed case letters, numbers and symbols
+ case 'PASS_TYPE_SYMBOL':
+ $chars[] = $sym;
+
+ // Require mixed case letters and numbers
case 'PASS_TYPE_ALPHA':
- $chars[] = $low;
- $chars[] = $upp;
$chars[] = $num;
- break;
- case 'PASS_TYPE_SYMBOL':
+ // Require mixed case letters
+ case 'PASS_TYPE_CASE':
$chars[] = $low;
$chars[] = $upp;
- $chars[] = $num;
- $chars[] = $sym;
- break;
+
+ // No requirements
+ case 'PASS_TYPE_ANY':
}
if ($pcre)