From efa18457f2ef4c1e34429070ca876ffec9958558 Mon Sep 17 00:00:00 2001 From: uwetews Date: Tue, 20 Sep 2016 16:06:01 +0200 Subject: [PATCH] - temporary fix for https://github.com/smarty-php/smarty/issues/293 main reason still under investigation --- libs/Smarty.class.php | 2 +- .../smarty_internal_compile_private_block_plugin.php | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 1116bd4a..6f7937fa 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -114,7 +114,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.31-dev/28'; + const SMARTY_VERSION = '3.1.31-dev/29'; /** * define variable scopes diff --git a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php index 165d2118..61756427 100644 --- a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php +++ b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php @@ -63,7 +63,7 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi $output .= "if (!is_callable({$callable})) {\nthrow new SmartyException('block tag \'{$tag}\' not callable or registered');\n}\n"; } $output .= "\$_smarty_tpl->smarty->_cache['_tag_stack'][] = array('{$tag}', {$_params});\n"; - $output .= "\$_block_repeat{$this->nesting}=true;\necho {$callback}({$_params}, null, \$_smarty_tpl, \$_block_repeat{$this->nesting});\nwhile (\$_block_repeat{$this->nesting}) {\nob_start();\n?>"; + $output .= "\$_block_repeat=true;\necho {$callback}({$_params}, null, \$_smarty_tpl, \$_block_repeat);\nwhile (\$_block_repeat) {\nob_start();\n?>"; $this->openTag($compiler, $tag, array($_params, $compiler->nocache, $callback)); // maybe nocache because of nocache variables or nocache plugin $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; @@ -88,12 +88,11 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi array('modifierlist' => $parameter[ 'modifier_list' ], 'value' => 'ob_get_clean()')) . ";\n"; } - $output = "nesting}=false;\n" . $mod_pre . + $output = "nesting});\n" . $mod_post . "}\n"; + ", \$_smarty_tpl, \$_block_repeat);\n" . $mod_post . "}\n"; $output .= "array_pop(\$_smarty_tpl->smarty->_cache['_tag_stack']);"; $output .= "?>"; - $this->nesting --; } return $output . "\n"; }