Skip to content

Commit

Permalink
fix recursion on generating passwords
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain committed Mar 26, 2018
1 parent 48bc751 commit 7eb5ff8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helper.php
Expand Up @@ -105,7 +105,7 @@ public function generatePassword($username, $try = 0) {
if($pw && $this->checkPolicy($pw, $username)) return $pw;

// still here? we might have clashed with the user name by accident
if($try < 3) return $this->generatePassword($try++);
if($try < 3) return $this->generatePassword($username, $try + 1);

// still here? now we have a real problem
throw new Exception('can\'t create a random password matching the password policy');
Expand Down

0 comments on commit 7eb5ff8

Please sign in to comment.