Jump to content

Edit History

cmak

cmak

Merci doekia

Implémenté sur un Prestashop v1.4.8.2 par surcharge de classe (override)

/override/classes/Customer.php

<?php
class Customer extends CustomerCore
{
	protected	$fieldsValidate = array('secure_key' => 'isMd5', 'lastname' => 'isCustomerName', 'firstname' => 'isCustomerName', 'email' => 'isEmail', 'passwd' => 'isPasswd',
		 'id_gender' => 'isUnsignedId', 'birthday' => 'isBirthDate', 'newsletter' => 'isBool', 'optin' => 'isBool', 'active' => 'isBool', 'note' => 'isCleanHtml', 'is_guest' => 'isBool');
}
?>

 

/override/classes/Validate.php

<?php
class Validate extends ValidateCore
{
    public static function isCustomerName($name)
    {
            if (preg_match('/www|http/ui',$name))
        {
                return false;
        }
            return preg_match('/^[^0-9!\[\]<>,;?=+()@#"°{}_$%:\/\\\*\^]*$/u', $name);
    }
}
?>

 

cmak

cmak

Merci doekia

Implémenté sur un Prestashop v1.4.8.2 par surcharge de classe (override)

/override/classes/Customer.php

<?php
class Customer extends CustomerCore
{
	protected	$fieldsValidate = array('secure_key' => 'isMd5', 'lastname' => 'isCustomerName', 'firstname' => 'isCustomerName', 'email' => 'isEmail', 'passwd' => 'isPasswd',
		 'id_gender' => 'isUnsignedId', 'birthday' => 'isBirthDate', 'newsletter' => 'isBool', 'optin' => 'isBool', 'active' => 'isBool', 'note' => 'isCleanHtml', 'is_guest' => 'isBool');

}
?>

 

/override/classes/Validate.php

<?php
class Validate extends ValidateCore
{
    public static function isCustomerName($name)
    {
            if (preg_match('/www|http/ui',$name))
        {
                return false;
        }
            return preg_match('/^[^0-9!\[\]<>,;?=+()@#"°{}_$%:\/\\\*\^]*$/u', $name);
    }
}
?>

 

×
×
  • Create New...