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)
|
===== 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
|
20.04.2015
|
||||||
- bugfix at a template function containing nocache code a parmeter could overwrite a template variable of same name
|
- 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
|
* smarty version
|
||||||
*/
|
*/
|
||||||
const SMARTY_VERSION = '3.1.22-dev/18';
|
const SMARTY_VERSION = '3.1.22-dev/19';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* define variable scopes
|
* define variable scopes
|
||||||
|
@@ -51,8 +51,11 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase
|
|||||||
{
|
{
|
||||||
// check and get attributes
|
// check and get attributes
|
||||||
$_attr = $this->getAttributes($compiler, $args);
|
$_attr = $this->getAttributes($compiler, $args);
|
||||||
// never compile as nocache code
|
$nocacheParam = $compiler->template->caching && ($compiler->tag_nocache || $compiler->nocache);
|
||||||
$compiler->suppressNocacheProcessing = true;
|
if (!$nocacheParam) {
|
||||||
|
// do not compile as nocache code
|
||||||
|
$compiler->suppressNocacheProcessing = true;
|
||||||
|
}
|
||||||
$compiler->tag_nocache = true;
|
$compiler->tag_nocache = true;
|
||||||
$_smarty_tpl = $compiler->template;
|
$_smarty_tpl = $compiler->template;
|
||||||
$_name = null;
|
$_name = null;
|
||||||
@@ -116,19 +119,19 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase
|
|||||||
// convert attributes into parameter array string
|
// convert attributes into parameter array string
|
||||||
$_paramsArray = array();
|
$_paramsArray = array();
|
||||||
foreach ($_attr as $_key => $_value) {
|
foreach ($_attr as $_key => $_value) {
|
||||||
$_paramsArray[] = "'$_key' => $_value";
|
$_paramsArray[] = "'$_key' => $_value";
|
||||||
}
|
}
|
||||||
$_params = 'array(' . implode(", ", $_paramsArray) . ')';
|
$_params = 'array(' . implode(", ", $_paramsArray) . ')';
|
||||||
// call insert
|
// call insert
|
||||||
if (isset($_assign)) {
|
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});?>";
|
$_output .= "echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \$_smarty_tpl, '{$_filepath}',{$_assign});?>";
|
||||||
} else {
|
} else {
|
||||||
$_output .= "\$_smarty_tpl->assign({$_assign} , {$_function} ({$_params},\$_smarty_tpl), true);?>";
|
$_output .= "\$_smarty_tpl->assign({$_assign} , {$_function} ({$_params},\$_smarty_tpl), true);?>";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$compiler->has_output = true;
|
$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}');?>";
|
$_output .= "echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \$_smarty_tpl, '{$_filepath}');?>";
|
||||||
} else {
|
} else {
|
||||||
$_output .= "echo {$_function}({$_params},\$_smarty_tpl);?>";
|
$_output .= "echo {$_function}({$_params},\$_smarty_tpl);?>";
|
||||||
|
Reference in New Issue
Block a user