From 0e28150b4a9e5d6ca6d4d505faa6dc8d604b8dd5 Mon Sep 17 00:00:00 2001 From: uwetews Date: Sun, 18 Oct 2015 11:35:08 +0200 Subject: [PATCH] - fix compiled code for new {block} assign attribute --- change_log.txt | 1 + libs/Smarty.class.php | 2 +- libs/sysplugins/smarty_internal_compile_block.php | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/change_log.txt b/change_log.txt index 8b994449..1c0c4348 100644 --- a/change_log.txt +++ b/change_log.txt @@ -4,6 +4,7 @@ - rework of template inheritance - speed and size optimizations - bugfix under HHVM temporary cache file must only be created when caches template was updated + - fix compiled code for new {block} assign attribute 18.09.2015 - bugfix {if $foo instanceof $bar} failed to compile if 2nd value is a variable https://github.com/smarty-php/smarty/issues/92 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 17e537d5..d31a3588 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -119,7 +119,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.28-dev/64'; + const SMARTY_VERSION = '3.1.28-dev/65'; /** * define variable scopes diff --git a/libs/sysplugins/smarty_internal_compile_block.php b/libs/sysplugins/smarty_internal_compile_block.php index 3a19f1bd..775a608d 100644 --- a/libs/sysplugins/smarty_internal_compile_block.php +++ b/libs/sysplugins/smarty_internal_compile_block.php @@ -201,7 +201,7 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_ $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode); $output = "tpl_vars[{$_assign}] = new Smarty_Variable(ob_get_contents());\n"; + $output .= "\$_smarty_tpl->tpl_vars[{$_assign}] = new Smarty_Variable(ob_get_clean());\n"; } $output .= "/*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\n"; $output .= "}\n"; @@ -232,7 +232,7 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_ $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode); $output = "tpl_vars[{$_assign}] = new Smarty_Variable(ob_get_contents());\n"; + $output .= "\$_smarty_tpl->tpl_vars[{$_assign}] = new Smarty_Variable(ob_get_clean());\n"; } $output .= "}\n"; $output .= "/* {/block '{$_name}'} */\n\n";