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;