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:
authorVincent Petry <vincent@nextcloud.com>2022-05-12 14:46:37 +0300
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-05-12 15:05:23 +0300
commitcca9cb2022f3cfb77dacee18b5c544a64f29aa6f (patch)
tree0a7d4cbca6ab1ab7c9191f66d56d77a1020715cd
parent447f5daf6f304c1478e4ed4415f6a7ef0e5578df (diff)
Fix old typo in length
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
-rw-r--r--lib/Generator.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Generator.php b/lib/Generator.php
index 60aa54f..062f0f9 100644
--- a/lib/Generator.php
+++ b/lib/Generator.php
@@ -57,7 +57,7 @@ class Generator {
// 8 minimum so we don't generate too short passwords
$minLength = 8;
}
- $lenght = $minLength;
+ $length = $minLength;
$password = '';
$chars = '';
@@ -67,19 +67,19 @@ class Generator {
if ($this->config->getEnforceUpperLowerCase()) {
$password .= $this->random->generate(1, ISecureRandom::CHAR_UPPER);
$password .= $this->random->generate(1, ISecureRandom::CHAR_LOWER);
- $lenght -= 2;
+ $length -= 2;
$chars .= ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER;
}
if ($this->config->getEnforceNumericCharacters()) {
$password .= $this->random->generate(1, ISecureRandom::CHAR_DIGITS);
- $lenght -= 1;
+ $length -= 1;
$chars .= ISecureRandom::CHAR_DIGITS;
}
if ($this->config->getEnforceSpecialCharacters()) {
$password .= $this->random->generate(1, ISecureRandom::CHAR_SYMBOLS);
- $lenght -= 1;
+ $length -= 1;
$chars .= ISecureRandom::CHAR_SYMBOLS;
}
@@ -87,7 +87,7 @@ class Generator {
$chars = ISecureRandom::CHAR_HUMAN_READABLE;
}
- $password .= $chars = $this->random->generate($lenght, $chars);
+ $password .= $chars = $this->random->generate($length, $chars);
try {
$this->validator->validate($password);
@@ -104,7 +104,7 @@ class Generator {
* Invalid so lets go for another round
* Reset the length so we don't run below zero
*/
- $lenght = $minLength;
+ $length = $minLength;
}
}