From 5d9f7ab65b626c08e6f196821b77ee61651bdf4e Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Mon, 1 Mar 2010 16:46:30 +0000 Subject: [PATCH] - bugfix on nocache code in {block} tags if child template was included by {include} --- change_log.txt | 3 + .../smarty_internal_compile_block.php | 55 ++++++++++--------- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/change_log.txt b/change_log.txt index f27037be..103c4cff 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +01/03/2010 +- bugfix on nocache code in {block} tags if child template was included by {include} + 27/02/2010 - allow block tags inside double quoted string diff --git a/libs/sysplugins/smarty_internal_compile_block.php b/libs/sysplugins/smarty_internal_compile_block.php index 7956bc48..0ccce92e 100644 --- a/libs/sysplugins/smarty_internal_compile_block.php +++ b/libs/sysplugins/smarty_internal_compile_block.php @@ -1,29 +1,29 @@ compiler = $compiler; $this->required_attributes = array('name'); - $this->optional_attributes = array('assign','nocache'); + $this->optional_attributes = array('assign', 'nocache'); // check and get attributes $_attr = $this->_get_attributes($args); $save = array($_attr, $compiler->template->extracted_compiled_code, $compiler->template->extract_code, $this->compiler->nocache); @@ -42,16 +42,16 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase { } /** -* Smarty Internal Plugin Compile BlockClose Class -*/ + * Smarty Internal Plugin Compile BlockClose Class + */ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase { /** - * Compiles code for the {/block} tag - * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @return string compiled code - */ + * Compiles code for the {/block} tag + * + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @return string compiled code + */ public function compile($args, $compiler) { $this->compiler = $compiler; @@ -90,6 +90,9 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase { } $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $_tpl->properties['file_dependency']); $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $_tpl->properties['function']); + if ($_tpl->has_nocache_code) { + $compiler->template->has_nocache_code = true; + } foreach($_tpl->required_plugins as $code => $tmp1) { foreach($tmp1 as $name => $tmp) { foreach($tmp as $type => $data) { @@ -110,4 +113,4 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase { } } -?> +?> \ No newline at end of file