diff --git a/change_log.txt b/change_log.txt index ecfc17ff..7346e7b0 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,9 @@ +13/11/2010 +- bugfix overloading problem when $smarty->fetch()/display() have been used in plugins + (introduced with 3.0.2) + +===== Smarty 3.0.3 ===== + 13/11/2010 - bugfix on {debug} - reverted location of loadPlugin() to Smarty class diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index ee3ffcdc..bf1fb2da 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -818,13 +818,6 @@ class Smarty_Internal_Template extends Smarty_Internal_Data { settype($this->tpl_vars[$tpl_var]->value, 'array'); } } - /** - * wrapper for display - */ - public function display () - { - return $this->smarty->display($this); - } /** * [util function] counts an array, arrayaccess/traversable or PDOStatement object @@ -861,10 +854,29 @@ class Smarty_Internal_Template extends Smarty_Internal_Data { /** * wrapper for fetch */ - public function fetch () + public function fetch ($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false) { - return $this->smarty->fetch($this); + if ($template == null) { + return $this->smarty->fetch($this); + } else { + return $this->smarty->fetch($template, $cache_id, $compile_id, $parent, $display); + } + } + + /** + * wrapper for display + */ + public function display ($template = null, $cache_id = null, $compile_id = null, $parent = null) + { + if ($template == null) { + return $this->smarty->display($this); + } else { + return $this->smarty->display($template, $cache_id, $compile_id, $parent); + } + + } + /** * set Smarty property in template context * @param string $property_name property name