From bd8af7c5cb0aa8c716c0bb2d04947a7c9f92f804 Mon Sep 17 00:00:00 2001 From: "uwe.tews@googlemail.com" Date: Thu, 28 Feb 2013 19:17:26 +0000 Subject: [PATCH] - bugfix nocache blocks could be lost when using CACHING_LIFETIME_SAVED (Issue #133) --- change_log.txt | 3 +++ libs/sysplugins/smarty_internal_template.php | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/change_log.txt b/change_log.txt index a71350cc..c5b2864f 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +28.01.2013 +- bugfix nocache blocks could be lost when using CACHING_LIFETIME_SAVED (Issue #133) + 24.01.2013 - bugfix wrong tag type in smarty_internal_templatecompilerbase.php could cause wrong plugin search order (Forum Topic 24028) diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index 29017edb..b6dd87fc 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -467,10 +467,15 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { } } if ($cache) { + // CACHING_LIFETIME_SAVED cache expiry has to be validated here since otherwise we'd define the unifunc + if ($this->caching === Smarty::CACHING_LIFETIME_SAVED && + $this->properties['cache_lifetime'] >= 0 && + (time() > ($this->cached->timestamp + $this->properties['cache_lifetime']))) { + $is_valid = false; + } $this->cached->valid = $is_valid; } else { - $this->mustCompile = !$is_valid; - } + $this->mustCompile = !$is_valid; } // store data in reusable Smarty_Template_Compiled if (!$cache) { $this->compiled->_properties = $properties;