mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
- bugfix template variables could not be passed as paramter in {include} when the include was in a {nocache} section (topic 25131)
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
- bugfix clearCompiledTemplate() did not delete files on WINDOWS when a compile_id was specified
|
- bugfix clearCompiledTemplate() did not delete files on WINDOWS when a compile_id was specified
|
||||||
|
|
||||||
18.04.2014
|
18.04.2014
|
||||||
- revert bugfix of 5.4.2015 because %-e date format is not supported on all operating systems
|
- revert bugfix of 5.4.2014 because %-e date format is not supported on all operating systems
|
||||||
|
|
||||||
===== 3.1.18 ===== (07.04.2014)
|
===== 3.1.18 ===== (07.04.2014)
|
||||||
06.04.2014
|
06.04.2014
|
||||||
|
@@ -216,8 +216,10 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase
|
|||||||
if (!empty($_attr)) {
|
if (!empty($_attr)) {
|
||||||
if ($_parent_scope == Smarty::SCOPE_LOCAL) {
|
if ($_parent_scope == Smarty::SCOPE_LOCAL) {
|
||||||
// create variables
|
// create variables
|
||||||
|
$nccode = '';
|
||||||
foreach ($_attr as $key => $value) {
|
foreach ($_attr as $key => $value) {
|
||||||
$_pairs[] = "'$key'=>$value";
|
$_pairs[] = "'$key'=>$value";
|
||||||
|
$nccode .= "\$_smarty_tpl->tpl_vars['$key'] = new Smarty_variable($value);\n";
|
||||||
}
|
}
|
||||||
$_vars = 'array(' . join(',', $_pairs) . ')';
|
$_vars = 'array(' . join(',', $_pairs) . ')';
|
||||||
} else {
|
} else {
|
||||||
@@ -232,6 +234,11 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase
|
|||||||
$_hash = $compiler->smarty->merged_templates_func[$tpl_name][$uid]['nocache_hash'];
|
$_hash = $compiler->smarty->merged_templates_func[$tpl_name][$uid]['nocache_hash'];
|
||||||
$_output = "<?php /* Call merged included template \"" . $tpl_name . "\" */\n";
|
$_output = "<?php /* Call merged included template \"" . $tpl_name . "\" */\n";
|
||||||
$_output .= "\$_tpl_stack[] = \$_smarty_tpl;\n";
|
$_output .= "\$_tpl_stack[] = \$_smarty_tpl;\n";
|
||||||
|
if (!empty($nccode) && $_caching == 9999 && $_smarty_tpl->caching) {
|
||||||
|
$compiler->suppressNocacheProcessing = false;
|
||||||
|
$_output .= substr($compiler->processNocacheCode('<?php ' .$nccode . "?>\n", true), 6, -3);
|
||||||
|
$compiler->suppressNocacheProcessing = true;
|
||||||
|
}
|
||||||
$_output .= " \$_smarty_tpl = \$_smarty_tpl->setupInlineSubTemplate($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope, '$_hash');\n";
|
$_output .= " \$_smarty_tpl = \$_smarty_tpl->setupInlineSubTemplate($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope, '$_hash');\n";
|
||||||
if (isset($_assign)) {
|
if (isset($_assign)) {
|
||||||
$_output .= 'ob_start(); ';
|
$_output .= 'ob_start(); ';
|
||||||
|
Reference in New Issue
Block a user