diff --git a/NEWS b/NEWS index 7c173de2..2a02eb34 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + - modified Smarty to pass itself to prefilter functions as the second + parameter. (Andrei) - fixed syntax error when including a non-existant template with security enabled. (Monte) - fixed comments handling to allow commenting out template blocks. (Andrei) diff --git a/Smarty_Compiler.class.php b/Smarty_Compiler.class.php index a18ecca0..7a5cfa4e 100644 --- a/Smarty_Compiler.class.php +++ b/Smarty_Compiler.class.php @@ -67,7 +67,7 @@ class Smarty_Compiler extends Smarty { if (is_array($this->prefilter_funcs) && count($this->prefilter_funcs) > 0) { foreach ($this->prefilter_funcs as $prefilter) { if (function_exists($prefilter)) { - $template_source = $prefilter($template_source); + $template_source = $prefilter($template_source, $this); } else { $this->_trigger_error_msg("prefilter function $prefilter does not exist."); } diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index a18ecca0..7a5cfa4e 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -67,7 +67,7 @@ class Smarty_Compiler extends Smarty { if (is_array($this->prefilter_funcs) && count($this->prefilter_funcs) > 0) { foreach ($this->prefilter_funcs as $prefilter) { if (function_exists($prefilter)) { - $template_source = $prefilter($template_source); + $template_source = $prefilter($template_source, $this); } else { $this->_trigger_error_msg("prefilter function $prefilter does not exist."); }