[-] BugFix : If a field is empty don't validate this one

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9658 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2011-10-26 16:04:04 +00:00
parent eb08f69f7b
commit f9c4e50c19
2 changed files with 2 additions and 2 deletions

View File

@@ -1684,7 +1684,7 @@ class AdminControllerCore extends Controller
/* Checking for fields validity */
foreach ($rules['validate'] as $field => $function)
if (($value = Tools::getValue($field)) !== false && ($field != 'passwd'))
if (!Validate::$function($value))
if (!Validate::$function($value) && !empty($value))
$this->_errors[] = $this->l('the field').
' <b>'.call_user_func(array($class_name, 'displayFieldName'), $field, $class_name).'</b> '.
$this->l('is invalid');