diff --git a/NEWS b/NEWS
index 94db98e5..672157a3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
+ - fixed bug with passing $smarty as reference in Smarty.compiler.class (messju)
- corrected output with {strip} and PHP tag newlines (Monte)
- added possibility to register function-callbacks as "array(&$obj, 'method)"
this affects register_function(), -block, -compiler_function, -modifier,
diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php
index d7e94b35..14ebe7c8 100644
--- a/libs/Smarty.class.php
+++ b/libs/Smarty.class.php
@@ -186,7 +186,7 @@ class Smarty
var $cache_modified_check = false;
/**
- * This determines how Smarty handles tags in templates.
+ * This determines how Smarty handles "" tags in templates.
* possible values:
*
* - SMARTY_PHP_PASSTHRU -> print tags as plain text
@@ -1330,7 +1330,7 @@ class Smarty
touch($_compile_file,filemtime($_file_path));
}
}
-
+
if ($this->debugging) {
$debug_start_time = $this->_get_microtime();
}
diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php
index e49228da..268e14bc 100644
--- a/libs/Smarty_Compiler.class.php
+++ b/libs/Smarty_Compiler.class.php
@@ -229,7 +229,8 @@ class Smarty_Compiler extends Smarty {
foreach ($this->_plugins['prefilter'] as $filter_name => $prefilter) {
if ($prefilter === false) continue;
if ($prefilter[3] || $this->_plugin_implementation_exists($prefilter[0])) {
- $template_source = call_user_func($prefilter[0], $template_source, $this);
+ $template_source = call_user_func_array($prefilter[0],
+ array($template_source, &$this));
$this->_plugins['prefilter'][$filter_name][3] = true;
} else {
$this->_trigger_fatal_error("[plugin] prefilter '$filter_name' is not implemented");
@@ -336,7 +337,8 @@ class Smarty_Compiler extends Smarty {
foreach ($this->_plugins['postfilter'] as $filter_name => $postfilter) {
if ($postfilter === false) continue;
if ($postfilter[3] || $this->_plugin_implementation_exists($postfilter[0])) {
- $template_compiled = call_user_func($postfilter[0], $template_compiled, $this);
+ $template_compiled = call_user_func_array($postfilter[0],
+ array($template_compiled, &$this));
$this->_plugins['postfilter'][$filter_name][3] = true;
} else {
$this->_trigger_fatal_error("Smarty plugin error: postfilter '$filter_name' is not implemented");
@@ -559,7 +561,8 @@ class Smarty_Compiler extends Smarty {
*/
if ($found) {
if ($have_function) {
- $output = '';
+ $output = '';
} else {
$this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__);
}