Passing Smarty as second parameter to prefilter functions.

This commit is contained in:
andrey
2001-08-10 20:34:17 +00:00
parent ca2529c128
commit 0c64d1694d
3 changed files with 4 additions and 2 deletions

2
NEWS
View File

@@ -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 - fixed syntax error when including a non-existant template with security
enabled. (Monte) enabled. (Monte)
- fixed comments handling to allow commenting out template blocks. (Andrei) - fixed comments handling to allow commenting out template blocks. (Andrei)

View File

@@ -67,7 +67,7 @@ class Smarty_Compiler extends Smarty {
if (is_array($this->prefilter_funcs) && count($this->prefilter_funcs) > 0) { if (is_array($this->prefilter_funcs) && count($this->prefilter_funcs) > 0) {
foreach ($this->prefilter_funcs as $prefilter) { foreach ($this->prefilter_funcs as $prefilter) {
if (function_exists($prefilter)) { if (function_exists($prefilter)) {
$template_source = $prefilter($template_source); $template_source = $prefilter($template_source, $this);
} else { } else {
$this->_trigger_error_msg("prefilter function $prefilter does not exist."); $this->_trigger_error_msg("prefilter function $prefilter does not exist.");
} }

View File

@@ -67,7 +67,7 @@ class Smarty_Compiler extends Smarty {
if (is_array($this->prefilter_funcs) && count($this->prefilter_funcs) > 0) { if (is_array($this->prefilter_funcs) && count($this->prefilter_funcs) > 0) {
foreach ($this->prefilter_funcs as $prefilter) { foreach ($this->prefilter_funcs as $prefilter) {
if (function_exists($prefilter)) { if (function_exists($prefilter)) {
$template_source = $prefilter($template_source); $template_source = $prefilter($template_source, $this);
} else { } else {
$this->_trigger_error_msg("prefilter function $prefilter does not exist."); $this->_trigger_error_msg("prefilter function $prefilter does not exist.");
} }