Revert "Merge pull request #1371 from drumm/CRM-12930-smarty-safe-mode"
authorkurund <kurund@civicrm.org>
Thu, 8 Aug 2013 19:31:40 +0000 (01:01 +0530)
committerkurund <kurund@civicrm.org>
Thu, 8 Aug 2013 19:31:40 +0000 (01:01 +0530)
This reverts commit 94ee5a7f70c82520c5ff4c736d5e6638ec49e780, reversing
changes made to a487a4bf777638a15e079baa489eabf13a7e035d.

CRM/Core/Smarty.php
CRM/Mailing/BAO/Mailing.php

index 3104453152b65bccd7f1c8da0089d4835d69eee1..43aab01c20eef5d721fa38473d6d86789d3474c7 100644 (file)
@@ -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) {
index 4b8cda012f7e241ce06228377a2c001e7a28989b..ee75e2aff585b1caa4c22139a6355f7418e31bd3 100644 (file)
@@ -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;
     }