Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/password_policy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2022-06-30 09:15:05 +0300
committerGitHub <noreply@github.com>2022-06-30 09:15:05 +0300
commitb19a56d8d79f4e61d8ee27d69baf4a06de8187f9 (patch)
treea055b278d3470e7dcf9d97a415bf1e13989cb6e8
parentf98c602efb54952713c8195fc23dcf0b96a554d4 (diff)
parent7268aa8f68983ea384873eb8d758baa2f022d739 (diff)
Merge pull request #363 from nextcloud/enh/shuffle-before-validation
-rw-r--r--lib/Generator.php6
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;
}
}