From ede81304c9b664b69e9943f63d69de3deeb4393a Mon Sep 17 00:00:00 2001 From: andrey Date: Thu, 21 Mar 2002 16:24:43 +0000 Subject: [PATCH] Make _current_file available to prefilters. --- Smarty_Compiler.class.php | 10 +++++----- libs/Smarty_Compiler.class.php | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Smarty_Compiler.class.php b/Smarty_Compiler.class.php index 5859ae4f..201bfc34 100644 --- a/Smarty_Compiler.class.php +++ b/Smarty_Compiler.class.php @@ -72,6 +72,11 @@ class Smarty_Compiler extends Smarty { $this->_filters_loaded = true; } + $this->_current_file = $tpl_file; + $this->_current_line_no = 1; + $ldq = preg_quote($this->left_delimiter, '!'); + $rdq = preg_quote($this->right_delimiter, '!'); + // run template source through prefilter functions if (count($this->_plugins['prefilter']) > 0) { foreach ($this->_plugins['prefilter'] as $filter_name => $prefilter) { @@ -84,11 +89,6 @@ class Smarty_Compiler extends Smarty { } } - $this->_current_file = $tpl_file; - $this->_current_line_no = 1; - $ldq = preg_quote($this->left_delimiter, '!'); - $rdq = preg_quote($this->right_delimiter, '!'); - /* Annihilate the comments. */ $template_source = preg_replace("!({$ldq})\*(.*?)\*({$rdq})!se", "'\\1*'.str_repeat(\"\n\", substr_count('\\2', \"\n\")) .'*\\3'", diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 5859ae4f..201bfc34 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -72,6 +72,11 @@ class Smarty_Compiler extends Smarty { $this->_filters_loaded = true; } + $this->_current_file = $tpl_file; + $this->_current_line_no = 1; + $ldq = preg_quote($this->left_delimiter, '!'); + $rdq = preg_quote($this->right_delimiter, '!'); + // run template source through prefilter functions if (count($this->_plugins['prefilter']) > 0) { foreach ($this->_plugins['prefilter'] as $filter_name => $prefilter) { @@ -84,11 +89,6 @@ class Smarty_Compiler extends Smarty { } } - $this->_current_file = $tpl_file; - $this->_current_line_no = 1; - $ldq = preg_quote($this->left_delimiter, '!'); - $rdq = preg_quote($this->right_delimiter, '!'); - /* Annihilate the comments. */ $template_source = preg_replace("!({$ldq})\*(.*?)\*({$rdq})!se", "'\\1*'.str_repeat(\"\n\", substr_count('\\2', \"\n\")) .'*\\3'",