- bugfix overloading problem when $smarty->fetch()/display() have been used in plugins

This commit is contained in:
uwe.tews@googlemail.com
2010-11-13 18:32:50 +00:00
parent 5d278ce5ad
commit 6ff5c28343
2 changed files with 17 additions and 5 deletions

View File

@@ -196,8 +196,6 @@ class Smarty extends Smarty_Internal_Data {
public $caching_type = 'file';
// internal cache resource types
public $cache_resource_types = array('file');
// internal cache resource objects
public $cache_resource_objects = array();
// internal config properties
public $properties = array();
// config type
@@ -387,12 +385,16 @@ class Smarty extends Smarty_Internal_Data {
* @param string $ |object $template the resource handle of the template file or template object
* @param mixed $cache_id cache id to be used with this template
* @param mixed $compile_id compile id to be used with this template
* @param object $parent next higher level of Smarty variables
* @return boolean cache status
*/
public function isCached($template, $cache_id = null, $compile_id = null)
public function isCached($template, $cache_id = null, $compile_id = null, $parent = null)
{
if ($parent === null) {
$parent = $this;
}
if (!($template instanceof $this->template_class)) {
$template = $this->createTemplate ($template, $cache_id, $compile_id, $this);
$template = $this->createTemplate ($template, $cache_id, $compile_id, $parent);
}
// return cache status of template
return $template->isCached();

View File

@@ -335,8 +335,18 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
*
* @return boolean true if cache is valid
*/
public function isCached ($no_render = true)
public function isCached ($template = null, $cache_id = null, $compile_id = null, $parent = null)
{
if ($template === null) {
$no_render = true;
} elseif ($template === false) {
$no_render = false;
} else {
if ($parent === null) {
$parent = $this;
}
$this->smarty->isCached ($template, $cache_id, $compile_id, $parent);
}
if ($this->isCached === null) {
$this->isCached = false;
if (($this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED) && !$this->resource_object->isEvaluated) {