From ac9aafbb115201058a54cc4fd514e3c4a1f0b194 Mon Sep 17 00:00:00 2001 From: messju Date: Thu, 15 Apr 2004 15:06:09 +0000 Subject: [PATCH] made smarty_core_write_compiled_include() php5-aware if someone knows a better way than patching the source with the tokenizer, please stand up! --- NEWS | 1 + libs/core/core.write_compiled_include.php | 24 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index c512c26f..573bcc75 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - make smarty_core_write_compiled_include() php5-aware (messju) - removed unused functionality to load a subset of lines from a file (messju) - fix is_secure() should only check if a file is_readable, not if the directory where it is in is readable (sagi, messju) diff --git a/libs/core/core.write_compiled_include.php b/libs/core/core.write_compiled_include.php index 9c6a4919..9c87cf0c 100644 --- a/libs/core/core.write_compiled_include.php +++ b/libs/core/core.write_compiled_include.php @@ -35,12 +35,32 @@ function smarty_core_write_compiled_include($params, &$smarty) $_include_compiled .= $params['plugins_code']; $_include_compiled .= "= 5.0) ? '_smarty' : 'this'; for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; $_i++) { $_match =& $_match_source[$_i]; + $source = $_match[4]; + if ($this_varname == '_smarty') { + /* rename $this to $_smarty in the sourcecode */ + $tokens = token_get_all('