diff --git a/change_log.txt b/change_log.txt index 3e1f1d8c..d490f794 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,5 +1,7 @@  ===== 3.1.22-dev ===== (xx.xx.2015) 14.03.2015 + - bugfix {nocache} {/nocache} tags corrupted code when used within a nocache section caused by a nocache template variable. + - bugfix template functions defined with {function} in an included subtemplate could not be called in nocache mode with {call... nocache} if the subtemplate had it's own cache file {forum 25452} diff --git a/libs/sysplugins/smarty_internal_compile_nocache.php b/libs/sysplugins/smarty_internal_compile_nocache.php index ba39717f..6f63dcb1 100644 --- a/libs/sysplugins/smarty_internal_compile_nocache.php +++ b/libs/sysplugins/smarty_internal_compile_nocache.php @@ -16,6 +16,13 @@ */ class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase { + /** + * Array of names of valid option flags + * + * @var array + */ + public $option_flags = array(); + /** * Compiles code for the {nocache} tag * This tag does not generate compiled output. It only sets a compiler flag. @@ -28,9 +35,7 @@ class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase public function compile($args, $compiler) { $_attr = $this->getAttributes($compiler, $args); - if ($_attr['nocache'] === true) { - $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); - } + $this->openTag($compiler, 'nocache', array($compiler->nocache)); // enter nocache mode $compiler->nocache = true; // this tag does not return compiled code @@ -61,7 +66,7 @@ class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase { $_attr = $this->getAttributes($compiler, $args); // leave nocache mode - $compiler->nocache = false; + list($compiler->nocache) = $this->closeTag($compiler, array('nocache')); // this tag does not return compiled code $compiler->has_code = false;