From 7015e711050a3acb0855b1c5547059bb4f262af0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Oct 2019 12:53:32 +0200 Subject: [PATCH] FIX #12041 --- .../security/generate/modGeneratePassPerso.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;