0

In Prestashop 1.5, the code to check if the customer password has 5 characters is located in Validate.php file and is the following :

    public static function isPasswd($passwd, $size = 5)
{
    return (Tools::strlen($passwd) >= $size && Tools::strlen($passwd) < 255);
}

Would anyone know how to change it, in order to check if the password complies with the five here below rules :

  • at least 8 characters
  • at least one uppercase
  • at least one lowercase
  • at least one special character
  • at least one digit

Thank you any advance for any help in this matter.

Patrick

user3278588
  • 81
  • 1
  • 12

1 Answers1

0

In PrestaShop 8, there will be a new password policy with the implementation of zxcvbn. You can see the implementation here: https://github.com/PrestaShop/PrestaShop/pull/28127

You can modify the isPasswd function and implement the checks you need. Here's an example of doing so: Password strength check in PHP

One more thing. This might not be the answer to your original question, but the truth is that if you still use PrestaShop 1.5, you should upgrade as soon as possible.

Krystian Podemski
  • 1,375
  • 1
  • 8
  • 12