From ab5236b55c23b59efa5216203c10d0bcdb52ba2a Mon Sep 17 00:00:00 2001 From: mohrt Date: Tue, 9 Jul 2002 13:34:19 +0000 Subject: [PATCH] make debug.tpl work with any delimiter --- NEWS | 1 + Smarty.class.php | 10 ++++++++++ libs/Smarty.class.php | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/NEWS b/NEWS index eb4c294f..8e1125f5 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - make debug.tpl work with any delimiter (Monte) - change logic in assign() and append() to test var names against != '' instead of empty() (Monte) - fix PHP notice in append() function (Monte) diff --git a/Smarty.class.php b/Smarty.class.php index 12bcab5f..292a99e6 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -721,6 +721,12 @@ class Smarty function _generate_debug_output() { // we must force compile the debug template in case the environment // changed between separate applications. + $_orig_ldelim = $this->left_delimiter; + $_orig_rdelim = $this->right_delimiter; + + $this->left_delimiter = '{'; + $this->right_delimiter = '}'; + ob_start(); $force_compile_orig = $this->force_compile; $this->force_compile = true; @@ -732,6 +738,10 @@ function _generate_debug_output() { $results = ob_get_contents(); $this->force_compile = $force_compile_orig; ob_end_clean(); + + $this->left_delimiter = $_orig_ldelim; + $this->right_delimiter = $_orig_rdelim; + return $results; } diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 12bcab5f..292a99e6 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -721,6 +721,12 @@ class Smarty function _generate_debug_output() { // we must force compile the debug template in case the environment // changed between separate applications. + $_orig_ldelim = $this->left_delimiter; + $_orig_rdelim = $this->right_delimiter; + + $this->left_delimiter = '{'; + $this->right_delimiter = '}'; + ob_start(); $force_compile_orig = $this->force_compile; $this->force_compile = true; @@ -732,6 +738,10 @@ function _generate_debug_output() { $results = ob_get_contents(); $this->force_compile = $force_compile_orig; ob_end_clean(); + + $this->left_delimiter = $_orig_ldelim; + $this->right_delimiter = $_orig_rdelim; + return $results; }