This commit is contained in:
Laurent Destailleur 2019-10-07 12:53:32 +02:00
parent 23de8694fa
commit 7015e71105

View File

@ -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;