Skip to content

Commit 2c831dc

Browse files
authored
Merge pull request PrestaShop#36689 from ShaiMagal/transformToCustomer
Can't transformToCustomer while password max length is shorter than default 16 length
2 parents 6612fc0 + cacaba5 commit 2c831dc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

classes/Customer.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,15 +1220,13 @@ public function transformToCustomer($idLang, $password = null)
12201220
/*
12211221
* If this is an anonymous conversion and we want the customer to set his own password,
12221222
* we set a random one for now.
1223-
* TODO - This should be revised in the future because 16 chars can be outside of bounds of
1224-
* isAcceptablePasswordLength. It should not be checked.
12251223
*/
12261224
if (empty($password)) {
12271225
$password = Tools::passwdGen(16, 'RANDOM');
1228-
}
1229-
1230-
if (!Validate::isAcceptablePasswordLength($password) || !Validate::isAcceptablePasswordScore($password)) {
1231-
return false;
1226+
} else {
1227+
if (!Validate::isAcceptablePasswordLength($password) || !Validate::isAcceptablePasswordScore($password)) {
1228+
return false;
1229+
}
12321230
}
12331231

12341232
/** @var \PrestaShop\PrestaShop\Core\Crypto\Hashing $crypto */

0 commit comments

Comments
 (0)