[-] #PSCFI-3773 : Added conditions in order to test the var $toName (to know if it's a string or an array)
This commit is contained in:
1 parent
d827efeb8d
commit
00e8ad5821
1 file changed
+10
-4
+10
-4
@@ -64,8 +64,11 @@ class MailCore
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do not crash for this error, that may be a complicated customer name
|
// Do not crash for this error, that may be a complicated customer name
|
||||||
if (!empty($toName) AND !Validate::isMailName($toName))
|
if(is_string($toName))
|
||||||
$toName = NULL;
|
{
|
||||||
|
if (!empty($toName) AND !Validate::isMailName($toName))
|
||||||
|
$toName = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!Validate::isTplName($template))
|
if (!Validate::isTplName($template))
|
||||||
{
|
{
|
||||||
@@ -92,8 +95,11 @@ class MailCore
|
|||||||
Tools::dieOrLog(Tools::displayError('Error: invalid email address'), $die);
|
Tools::dieOrLog(Tools::displayError('Error: invalid email address'), $die);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($toName AND is_array($toName) AND Validate::isGenericName($toName[$key]))
|
if(is_array($toName))
|
||||||
$to_name = $toName[$key];
|
{
|
||||||
|
if ($toName AND is_array($toName) AND Validate::isGenericName($toName[$key]))
|
||||||
|
$to_name = $toName[$key];
|
||||||
|
}
|
||||||
$to_list->addTo($addr, $to_name);
|
$to_list->addTo($addr, $to_name);
|
||||||
}
|
}
|
||||||
$to_plugin = $to[0];
|
$to_plugin = $to[0];
|
||||||
|
|||||||
Reference in new issue
Block a user