diff --git a/classes/Customer.php b/classes/Customer.php index 20310b8a6d978..a1407497755e4 100644 --- a/classes/Customer.php +++ b/classes/Customer.php @@ -1220,15 +1220,13 @@ public function transformToCustomer($idLang, $password = null) /* * If this is an anonymous conversion and we want the customer to set his own password, * we set a random one for now. - * TODO - This should be revised in the future because 16 chars can be outside of bounds of - * isAcceptablePasswordLength. It should not be checked. */ if (empty($password)) { $password = Tools::passwdGen(16, 'RANDOM'); - } - - if (!Validate::isAcceptablePasswordLength($password) || !Validate::isAcceptablePasswordScore($password)) { - return false; + } else { + if (!Validate::isAcceptablePasswordLength($password) || !Validate::isAcceptablePasswordScore($password)) { + return false; + } } /** @var \PrestaShop\PrestaShop\Core\Crypto\Hashing $crypto */