[-] MO : #PSFV-636 - Remove warnings lile "Warning: Function displayHeader() is deprecated" with module blockwishlist

This commit is contained in:
mDeflotte
2012-03-15 17:22:59 +00:00
parent 54ac308b76
commit df78dc663f
+14 -14
View File
@@ -60,43 +60,43 @@ class MailCore
if (!empty($from) && !Validate::isEmail($from)) if (!empty($from) && !Validate::isEmail($from))
{ {
Tools::dieOrLog(Tools::displayError('Error: parameter "from" is corrupted'), $die); Tools::dieOrLog(Tools::displayError('Error: parameter "from" is corrupted'), $die);
return false; return false;
} }
if (!empty($fromName) && !Validate::isMailName($fromName)) if (!empty($fromName) && !Validate::isMailName($fromName))
{ {
Tools::dieOrLog(Tools::displayError('Error: parameter "fromName" is corrupted'), $die); Tools::dieOrLog(Tools::displayError('Error: parameter "fromName" is corrupted'), $die);
return false; return false;
} }
if (!is_array($to) && !Validate::isEmail($to)) if (!is_array($to) && !Validate::isEmail($to))
{ {
Tools::dieOrLog(Tools::displayError('Error: parameter "to" is corrupted'), $die); Tools::dieOrLog(Tools::displayError('Error: parameter "to" is corrupted'), $die);
return false; return false;
} }
if (!is_array($templateVars)) if (!is_array($templateVars))
{ {
Tools::dieOrLog(Tools::displayError('Error: parameter "templateVars" is not an array'), $die); Tools::dieOrLog(Tools::displayError('Error: parameter "templateVars" is not an array'), $die);
return false; return false;
} }
// 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 (is_string($toName)) if (is_string($toName))
{ {
if (!empty($toName) && !Validate::isMailName($toName)) if (!empty($toName) && !Validate::isMailName($toName))
$toName = null; $toName = null;
} }
if (!Validate::isTplName($template)) if (!Validate::isTplName($template))
{ {
Tools::dieOrLog(Tools::displayError('Error: invalid e-mail template'), $die); Tools::dieOrLog(Tools::displayError('Error: invalid e-mail template'), $die);
return false; return false;
} }
if (!Validate::isMailSubject($subject)) if (!Validate::isMailSubject($subject))
{ {
Tools::dieOrLog(Tools::displayError('Error: invalid e-mail subject'), $die); Tools::dieOrLog(Tools::displayError('Error: invalid e-mail subject'), $die);
return false; return false;
} }
/* Construct multiple recipients list if needed */ /* Construct multiple recipients list if needed */
@@ -117,7 +117,7 @@ class MailCore
if ($toName && is_array($toName) && Validate::isGenericName($toName[$key])) if ($toName && is_array($toName) && Validate::isGenericName($toName[$key]))
$to_name = $toName[$key]; $to_name = $toName[$key];
} }
/* Encode accentuated chars */ /* Encode accentuated chars */
$to_list->addTo($addr, '=?UTF-8?B?'.base64_encode($to_name).'?='); $to_list->addTo($addr, '=?UTF-8?B?'.base64_encode($to_name).'?=');
} }
$to_plugin = $to[0]; $to_plugin = $to[0];