mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
- bugfix a nocache template variable used as parameter at {insert} was by mistake cached
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
===== 3.1.22-dev ===== (xx.xx.2015)
|
||||
23.04.2015
|
||||
- bugfix a nocache template variable used as parameter at {insert} was by mistake cached
|
||||
|
||||
20.04.2015
|
||||
- bugfix at a template function containing nocache code a parmeter could overwrite a template variable of same name
|
||||
|
||||
|
@@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
||||
/**
|
||||
* smarty version
|
||||
*/
|
||||
const SMARTY_VERSION = '3.1.22-dev/18';
|
||||
const SMARTY_VERSION = '3.1.22-dev/19';
|
||||
|
||||
/**
|
||||
* define variable scopes
|
||||
|
@@ -51,8 +51,11 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase
|
||||
{
|
||||
// check and get attributes
|
||||
$_attr = $this->getAttributes($compiler, $args);
|
||||
// never compile as nocache code
|
||||
$nocacheParam = $compiler->template->caching && ($compiler->tag_nocache || $compiler->nocache);
|
||||
if (!$nocacheParam) {
|
||||
// do not compile as nocache code
|
||||
$compiler->suppressNocacheProcessing = true;
|
||||
}
|
||||
$compiler->tag_nocache = true;
|
||||
$_smarty_tpl = $compiler->template;
|
||||
$_name = null;
|
||||
@@ -121,14 +124,14 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase
|
||||
$_params = 'array(' . implode(", ", $_paramsArray) . ')';
|
||||
// call insert
|
||||
if (isset($_assign)) {
|
||||
if ($_smarty_tpl->caching) {
|
||||
if ($_smarty_tpl->caching && !$nocacheParam) {
|
||||
$_output .= "echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \$_smarty_tpl, '{$_filepath}',{$_assign});?>";
|
||||
} else {
|
||||
$_output .= "\$_smarty_tpl->assign({$_assign} , {$_function} ({$_params},\$_smarty_tpl), true);?>";
|
||||
}
|
||||
} else {
|
||||
$compiler->has_output = true;
|
||||
if ($_smarty_tpl->caching) {
|
||||
if ($_smarty_tpl->caching && !$nocacheParam) {
|
||||
$_output .= "echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \$_smarty_tpl, '{$_filepath}');?>";
|
||||
} else {
|
||||
$_output .= "echo {$_function}({$_params},\$_smarty_tpl);?>";
|
||||
|
Reference in New Issue
Block a user