[-] BO : fixed bug in contact message with html
This commit is contained in:
@@ -50,7 +50,7 @@ class ContactControllerCore extends FrontController
|
||||
$message = Tools::htmlentitiesUTF8(Tools::getValue('message'));
|
||||
if (!($from = trim(Tools::getValue('from'))) || !Validate::isEmail($from))
|
||||
$this->errors[] = Tools::displayError('Invalid e-mail address');
|
||||
else if (!($message = Tools::nl2br($message)))
|
||||
else if (!$message)
|
||||
$this->errors[] = Tools::displayError('Message cannot be blank');
|
||||
else if (!Validate::isCleanHtml($message))
|
||||
$this->errors[] = Tools::displayError('Invalid message');
|
||||
@@ -119,7 +119,7 @@ class ContactControllerCore extends FrontController
|
||||
{
|
||||
$mail_var_list = array(
|
||||
'{email}' => $from,
|
||||
'{message}' => stripslashes($message),
|
||||
'{message}' => Tools::nl2br(stripslashes($message)),
|
||||
'{id_order}' => (int)Tools::getValue('id_order'),
|
||||
'{attached_file}' => $_FILES['fileUpload']['name'] ? $_FILES['fileUpload']['name'] : '');
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
else
|
||||
$ct = new CustomerThread((int)$id_customer_thread);
|
||||
$cm->id_customer_thread = $ct->id;
|
||||
$cm->message = Tools::htmlentitiesutf8(Tools::nl2br($msgText));
|
||||
$cm->message = Tools::htmlentitiesutf8($msgText);
|
||||
$cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']);
|
||||
$cm->add();
|
||||
|
||||
@@ -103,11 +103,12 @@ class OrderDetailControllerCore extends FrontController
|
||||
if (Validate::isLoadedObject($customer))
|
||||
Mail::Send($this->context->language->id, 'order_customer_comment', Mail::l('Message from a customer'),
|
||||
array(
|
||||
'{lastname}' => $customer->lastname,
|
||||
'{firstname}' => $customer->firstname,
|
||||
'{email}' => $customer->email,
|
||||
'{id_order}' => (int)($order->id),
|
||||
'{message}' => $msgText),
|
||||
'{lastname}' => $customer->lastname,
|
||||
'{firstname}' => $customer->firstname,
|
||||
'{email}' => $customer->email,
|
||||
'{id_order}' => (int)($order->id),
|
||||
'{message}' => Tools::nl2br($msgText)
|
||||
),
|
||||
$to, $toName, $customer->email, $customer->firstname.' '.$customer->lastname);
|
||||
|
||||
if (Tools::getValue('ajax') != 'true')
|
||||
|
||||
Reference in New Issue
Block a user