From df68963fd6be4787a0c9f82ac1a0f9f307ce9c53 Mon Sep 17 00:00:00 2001 From: kurund Date: Fri, 9 Aug 2013 01:01:40 +0530 Subject: [PATCH] Revert "Merge pull request #1371 from drumm/CRM-12930-smarty-safe-mode" This reverts commit 94ee5a7f70c82520c5ff4c736d5e6638ec49e780, reversing changes made to a487a4bf777638a15e079baa489eabf13a7e035d. --- CRM/Core/Smarty.php | 10 +--------- CRM/Mailing/BAO/Mailing.php | 8 ++++++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/CRM/Core/Smarty.php b/CRM/Core/Smarty.php index 3104453152..43aab01c20 100644 --- a/CRM/Core/Smarty.php +++ b/CRM/Core/Smarty.php @@ -186,15 +186,7 @@ class CRM_Core_Smarty extends Smarty { * @param boolean $display */ function fetch($resource_name, $cache_id = NULL, $compile_id = NULL, $display = FALSE) { - if (preg_match( '/^(\s+)?string:/', $resource_name)) { - $old_security = $this->security; - $this->security = TRUE; - } - $output = parent::fetch($resource_name, $cache_id, $compile_id, $display); - if (isset($old_security)) { - $this->security = $old_security; - } - return $output; + return parent::fetch($resource_name, $cache_id, $compile_id, $display); } function appendValue($name, $value) { diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 4b8cda012f..ee75e2aff5 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -1187,7 +1187,9 @@ ORDER BY civicrm_email.is_bulkmail DESC )) { $textBody = join('', $text); if ($useSmarty) { - $textBody = $smarty->fetch("string:$textBody"); + $smarty->security = TRUE; + $textBody = $smarty->fetch("string:$textBody"); + $smarty->security = FALSE; } $mailParams['text'] = $textBody; } @@ -1197,7 +1199,9 @@ ORDER BY civicrm_email.is_bulkmail DESC ))) { $htmlBody = join('', $html); if ($useSmarty) { - $htmlBody = $smarty->fetch("string:$htmlBody"); + $smarty->security = TRUE; + $htmlBody = $smarty->fetch("string:$htmlBody"); + $smarty->security = FALSE; } $mailParams['html'] = $htmlBody; } -- 2.25.1