// validator on message field

This commit is contained in:
Rémi Gaillard
2013-11-04 14:21:42 +01:00
parent b8b7fbaf71
commit bf8cd29868
2 changed files with 12 additions and 8 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ class ContactControllerCore extends FrontController
$cm->message = $message;
if (isset($fileAttachment['rename']) && !empty($fileAttachment['rename']) && rename($fileAttachment['tmp_name'], _PS_MODULE_DIR_.'../upload/'.basename($fileAttachment['rename'])))
$cm->file_name = $fileAttachment['rename'];
$cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']);
$cm->ip_address = ip2long(Tools::getRemoteAddr());
$cm->user_agent = $_SERVER['HTTP_USER_AGENT'];
if (!$cm->add())
$this->errors[] = Tools::displayError('An error occurred while sending the message.');