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:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2022-06-30 18:16:21 +0300
committerGitHub <noreply@github.com>2022-06-30 18:16:21 +0300
commit74665d5377c4ae6224375c1b2988fbda278f8864 (patch)
treeba61823b038a2e3893f4c1eaf1eb065f2a9cb95c
parent0bfb0a2bd4e63ce21023131361557932724b14a2 (diff)
parent87dfe5ea95b48f6fccac6e3a8b87e10e7fa5f697 (diff)
Merge pull request #365 from nextcloud/backport/363/stable23
[stable23] Shuffle before validating
-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;
}
}