mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
- bugfix overloading problem when $smarty->fetch()/display() have been used in plugins
This commit is contained in:
@@ -196,8 +196,6 @@ class Smarty extends Smarty_Internal_Data {
|
|||||||
public $caching_type = 'file';
|
public $caching_type = 'file';
|
||||||
// internal cache resource types
|
// internal cache resource types
|
||||||
public $cache_resource_types = array('file');
|
public $cache_resource_types = array('file');
|
||||||
// internal cache resource objects
|
|
||||||
public $cache_resource_objects = array();
|
|
||||||
// internal config properties
|
// internal config properties
|
||||||
public $properties = array();
|
public $properties = array();
|
||||||
// config type
|
// 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 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 $cache_id cache id to be used with this template
|
||||||
* @param mixed $compile_id compile 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
|
* @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)) {
|
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 cache status of template
|
||||||
return $template->isCached();
|
return $template->isCached();
|
||||||
|
@@ -335,8 +335,18 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
*
|
*
|
||||||
* @return boolean true if cache is valid
|
* @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) {
|
if ($this->isCached === null) {
|
||||||
$this->isCached = false;
|
$this->isCached = false;
|
||||||
if (($this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED) && !$this->resource_object->isEvaluated) {
|
if (($this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED) && !$this->resource_object->isEvaluated) {
|
||||||
|
Reference in New Issue
Block a user