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('