[-] BO : #PSCFV-3834 : Check if file upload exist when use the contact form

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17121 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2012-08-31 09:05:25 +00:00
parent be85673853
commit 324c0a556d
+3 -2
View File
@@ -69,7 +69,7 @@ class ContactControllerCore extends FrontController
$contact = new Contact($id_contact, $this->context->language->id);
if (!((
$id_customer_thread = (int)Tools::getValue('id_customer_thread')
($id_customer_thread = (int)Tools::getValue('id_customer_thread'))
&& (int)Db::getInstance()->getValue('
SELECT cm.id_customer_thread FROM '._DB_PREFIX_.'customer_thread cm
WHERE cm.id_customer_thread = '.(int)$id_customer_thread.' AND cm.id_shop = '.(int)$this->context->shop->id.' AND token = \''.pSQL(Tools::getValue('token')).'\'')
@@ -125,7 +125,8 @@ class ContactControllerCore extends FrontController
'{message}' => Tools::nl2br(stripslashes($message)),
'{id_order}' => $id_order,
'{order_name}' => $order->getUniqReference(),
'{attached_file}' => $_FILES['fileUpload']['name'] ? $_FILES['fileUpload']['name'] : '');
'{attached_file}' => isset($_FILES['fileUpload'], $_FILES['fileUpload']['name']) ? $_FILES['fileUpload']['name'] : ''
);
if (Mail::Send($this->context->language->id, 'contact', Mail::l('Message from contact form'),
$mail_var_list, $contact->email, $contact->name, $from, ($customer->id ? $customer->firstname.' '.$customer->lastname : ''),