[-] #PSCFI-3773 : Added conditions in order to test the var $toName (to know if it's a string or an array)

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9569 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
aNiassy
2011-10-24 08:22:48 +00:00
parent f5c09af54e
commit 9f60944c60
+10 -4
View File
@@ -64,8 +64,11 @@ class MailCore
}
// Do not crash for this error, that may be a complicated customer name
if (!empty($toName) AND !Validate::isMailName($toName))
$toName = NULL;
if(is_string($toName))
{
if (!empty($toName) AND !Validate::isMailName($toName))
$toName = NULL;
}
if (!Validate::isTplName($template))
{
@@ -92,8 +95,11 @@ class MailCore
Tools::dieOrLog(Tools::displayError('Error: invalid email address'), $die);
return false;
}
if ($toName AND is_array($toName) AND Validate::isGenericName($toName[$key]))
$to_name = $toName[$key];
if(is_array($toName))
{
if ($toName AND is_array($toName) AND Validate::isGenericName($toName[$key]))
$to_name = $toName[$key];
}
$to_list->addTo($addr, $to_name);
}
$to_plugin = $to[0];