mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
Make _current_file available to prefilters.
This commit is contained in:
@@ -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'",
|
||||
|
@@ -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'",
|
||||
|
Reference in New Issue
Block a user