diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2022-06-30 09:15:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-30 09:15:05 +0300 |
commit | b19a56d8d79f4e61d8ee27d69baf4a06de8187f9 (patch) | |
tree | a055b278d3470e7dcf9d97a415bf1e13989cb6e8 | |
parent | f98c602efb54952713c8195fc23dcf0b96a554d4 (diff) | |
parent | 7268aa8f68983ea384873eb8d758baa2f022d739 (diff) |
Merge pull request #363 from nextcloud/enh/shuffle-before-validation
-rw-r--r-- | lib/Generator.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Generator.php b/lib/Generator.php index ca9ea63..b578b84 100644 --- a/lib/Generator.php +++ b/lib/Generator.php @@ -85,6 +85,9 @@ class Generator { $password .= $chars = $this->random->generate($length, $chars); + // Shuffle string so the order is random + $password = str_shuffle($password); + try { $this->validator->validate($password); @@ -108,9 +111,6 @@ class Generator { throw new HintException('Could not generate a valid password'); } - // Shuffle string so the order is random - $password = str_shuffle($password); - return $password; } } |