mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
Passing Smarty as second parameter to prefilter functions.
This commit is contained in:
2
NEWS
2
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
|
- 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)
|
||||||
|
@@ -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.");
|
||||||
}
|
}
|
||||||
|
@@ -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.");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user