From f983e0eaf1dc0e0bd580f6afc3a7ebe38fc6e180 Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Mon, 30 Sep 2013 16:25:58 +0200 Subject: [PATCH] [-] BO : FixBug #PSCFV-10380 - Missing lang file existence verification. --- classes/Mail.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes/Mail.php b/classes/Mail.php index c4367878a..910f23494 100644 --- a/classes/Mail.php +++ b/classes/Mail.php @@ -235,8 +235,13 @@ class MailCore include_once($template_path.$iso.'/lang.php'); else if ($module_name && file_exists($theme_path.'mails/'.$iso.'/lang.php')) include_once($theme_path.'mails/'.$iso.'/lang.php'); - else + else if (file_exists(_PS_MAIL_DIR_.$iso.'/lang.php')) include_once(_PS_MAIL_DIR_.$iso.'/lang.php'); + else + { + Tools::dieOrLog(Tools::displayError('Error - The lang file is missing for :').' '.$iso, $die); + return false; + } /* Create mail and attach differents parts */ $message = new Swift_Message('['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.$subject);