mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
- bugfix {nocache} {/nocache} tags corrupted code when used within a nocache section caused by a nocache template variable
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
===== 3.1.22-dev ===== (xx.xx.2015)
|
===== 3.1.22-dev ===== (xx.xx.2015)
|
||||||
14.03.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
|
- 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}
|
mode with {call... nocache} if the subtemplate had it's own cache file {forum 25452}
|
||||||
|
|
||||||
|
@@ -16,6 +16,13 @@
|
|||||||
*/
|
*/
|
||||||
class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase
|
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
|
* Compiles code for the {nocache} tag
|
||||||
* This tag does not generate compiled output. It only sets a compiler flag.
|
* 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)
|
public function compile($args, $compiler)
|
||||||
{
|
{
|
||||||
$_attr = $this->getAttributes($compiler, $args);
|
$_attr = $this->getAttributes($compiler, $args);
|
||||||
if ($_attr['nocache'] === true) {
|
$this->openTag($compiler, 'nocache', array($compiler->nocache));
|
||||||
$compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
|
|
||||||
}
|
|
||||||
// enter nocache mode
|
// enter nocache mode
|
||||||
$compiler->nocache = true;
|
$compiler->nocache = true;
|
||||||
// this tag does not return compiled code
|
// 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);
|
$_attr = $this->getAttributes($compiler, $args);
|
||||||
// leave nocache mode
|
// leave nocache mode
|
||||||
$compiler->nocache = false;
|
list($compiler->nocache) = $this->closeTag($compiler, array('nocache'));
|
||||||
// this tag does not return compiled code
|
// this tag does not return compiled code
|
||||||
$compiler->has_code = false;
|
$compiler->has_code = false;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user