diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php index bccb1353087..3229aa1a616 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -206,7 +206,7 @@ class modGeneratePassPerso extends ModeleGenPassword } /** - * consecutive iterations of the same character + * Consecutive iterations of the same character * * @param string $password Password to check * @return int 0 if KO, >0 if OK @@ -214,8 +214,12 @@ class modGeneratePassPerso extends ModeleGenPassword public function consecutiveInterationSameCharacter($password) { $last = ""; + + if (empty($this->NbRepeat)) return 1; + $count = 0; $char = str_split($password); + foreach($char as $c) { if($c != $last) { $last = $c;