Skip to content

Commit

Permalink
Better readability
Browse files Browse the repository at this point in the history
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Aug 27, 2019
1 parent 1ab11d0 commit 4000ea6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Validator/CommonPasswordsValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ public function __construct(PasswordPolicyConfig $config, IL10N $l) {

public function validate(string $password): void {
$enforceNonCommonPassword = $this->config->getEnforceNonCommonPassword();
if($enforceNonCommonPassword) {
$passwordFile = __DIR__ . '/../../lists/list-'.strlen($password).'.php';
if(file_exists($passwordFile)) {
$passwordFile = __DIR__ . '/../../lists/list-'.strlen($password).'.php';
if($enforceNonCommonPassword && file_exists($passwordFile)) {
$commonPasswords = require_once $passwordFile;
if (isset($commonPasswords[strtolower($password)])) {
$message = 'Password is among the 1,000,000 most common ones. Please make it unique.';
Expand Down

0 comments on commit 4000ea6

Please sign in to comment.