From 74b4fd398fffa942643ba71a22cf5575355ee5f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 4 Mar 2013 16:43:51 +0100 Subject: [PATCH] [-] Core: Fix #PSCFV-7813 override of modules email templates not working because of directory separator --- classes/Mail.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Mail.php b/classes/Mail.php index 77ee422c5..9c9de6698 100644 --- a/classes/Mail.php +++ b/classes/Mail.php @@ -197,13 +197,13 @@ class MailCore $override_mail = false; // get templatePath - if (preg_match('#'.__PS_BASE_URI__.'modules/#', $template_path) && preg_match('#modules/([a-z0-9_-]+)/#ui', $template_path, $res)) + if (preg_match('#'.__PS_BASE_URI__.'modules/#', str_replace(DIRECTORY_SEPARATOR, '/', $template_path)) && preg_match('#modules/([a-z0-9_-]+)/#ui', str_replace(DIRECTORY_SEPARATOR, '/',$template_path), $res)) $module_name = $res[1]; if ($module_name !== false && (file_exists($theme_path.'modules/'.$module_name.'/mails/'.$template.'.txt') || file_exists($theme_path.'modules/'.$module_name.'/mails/'.$template.'.html'))) $template_path = $theme_path.'modules/'.$module_name.'/mails/'; - else if (file_exists($theme_path.'mails/'.$template.'.txt') || file_exists($theme_path.'mails/'.$template.'.html')) + elseif (file_exists($theme_path.'mails/'.$template.'.txt') || file_exists($theme_path.'mails/'.$template.'.html')) { $template_path = $theme_path.'mails/'; $override_mail = true;