diff --git a/change_log.txt b/change_log.txt index a580ea04..8b522606 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,6 +1,7 @@ 11/12/2009 - fixed variable filenames in {include_php} and {insert} - added scope to Smarty variables in the {block} tag compiler +- fix on nocache code in child {block} tags 11/11/2009 - fixed {foreachelse}, {forelse}, {sectionelse} compiled code at nocache variables diff --git a/libs/sysplugins/smarty_internal_cacher_inlinecode.php b/libs/sysplugins/smarty_internal_cacher_inlinecode.php index 906b0a28..eb943fed 100644 --- a/libs/sysplugins/smarty_internal_cacher_inlinecode.php +++ b/libs/sysplugins/smarty_internal_cacher_inlinecode.php @@ -39,7 +39,7 @@ class Smarty_Internal_Cacher_InlineCode { // If the template is not evaluated and we have a nocache section and or a nocache tag if ($is_code) { // generate replacement code - if (!$compiler->template->isEvaluated() && $compiler->template->caching && + if ((!$compiler->template->isEvaluated() || $compiler->template->forceNocache) && $compiler->template->caching && ($compiler->nocache || $compiler->tag_nocache)) { $compiler->tag_nocache = false; $_output = str_replace("'", "\'", $content); diff --git a/libs/sysplugins/smarty_internal_compile_extend.php b/libs/sysplugins/smarty_internal_compile_extend.php index 63098b6d..521d20ad 100644 --- a/libs/sysplugins/smarty_internal_compile_extend.php +++ b/libs/sysplugins/smarty_internal_compile_extend.php @@ -58,7 +58,7 @@ class Smarty_Internal_Compile_Extend extends Smarty_Internal_CompileBase { // compile block content $_tpl = $this->smarty->createTemplate('string:' . $block_content,null,null,$template); $_tpl->template_filepath = $this->compiler->template->getTemplateFilepath(); -// $_tpl->suppressFileDependency = true; + $_tpl->forceNocache= true; $_compiled_content = $_tpl->getCompiledTemplate(); unset($_tpl); $_name = trim($_match[3], "\"'}"); diff --git a/libs/sysplugins/smarty_internal_resource_extend.php b/libs/sysplugins/smarty_internal_resource_extend.php index a2eaa040..d832f01c 100644 --- a/libs/sysplugins/smarty_internal_resource_extend.php +++ b/libs/sysplugins/smarty_internal_resource_extend.php @@ -111,7 +111,7 @@ class Smarty_Internal_Resource_Extend { // compile block content $_tpl = $this->smarty->createTemplate('string:' . $block_content,null,null,$template); $_tpl->template_filepath = $this->template->getTemplateFilepath(); -// $_tpl->suppressFileDependency = true; + $_tpl->forceNocache= true; $_compiled_content = $_tpl->getCompiledTemplate(); unset($_tpl); $_name = trim($_match[3], "\"'}"); diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index 8a6e1ed9..22a9e6ef 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -25,6 +25,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { public $cacher_class = null; public $caching_type = null; public $force_compile = null; + public $forceNocache = false; // Template resource public $template_resource = null; public $resource_type = null;