Skip to content

Commit

Permalink
[-] CORE : Validate - Set password length to constante
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromenadaud committed Feb 20, 2014
1 parent 3605ba7 commit 530329f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions classes/Validate.php
Expand Up @@ -26,6 +26,9 @@

class ValidateCore
{
const ADMIN_PASSWORD_LENGTH = 8;
const PASSWORD_LENGTH = 5;

public static function isIp2Long($ip)
{
return preg_match('#^-?[0-9]+$#', (string)$ip);
Expand Down Expand Up @@ -426,14 +429,14 @@ public static function isReference($reference)
* @param int $size
* @return boolean Validity is ok or not
*/
public static function isPasswd($passwd, $size = 5)
public static function isPasswd($passwd, $size = Validate::PASSWORD_LENGTH)
{
return (Tools::strlen($passwd) >= $size && Tools::strlen($passwd) < 255);
}

public static function isPasswdAdmin($passwd)
{
return Validate::isPasswd($passwd, 8);
return Validate::isPasswd($passwd, Validate::ADMIN_PASSWORD_LENGTH);
}

/**
Expand Down

0 comments on commit 530329f

Please sign in to comment.