[-] BO : fixed bug in contact message with html

This commit is contained in:
vAugagneur
2012-02-28 11:05:21 +00:00
parent 46eb7645df
commit e061e9a49c
7 changed files with 140 additions and 43 deletions
+2 -2
View File
@@ -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'] : '');