diff --git a/change_log.txt b/change_log.txt index 035a35dc..414a46ea 100644 --- a/change_log.txt +++ b/change_log.txt @@ -14,7 +14,8 @@ - optimize use_include_path processing - relocate properties for size optimization - remove redundant code - + - bugfix compiling super globals like {$smarty.get.foo} did fail in the master branch https://github.com/smarty-php/smarty/issues/77 + 06.08.2015 - avoid possible circular object references caused by parser/lexer objects - rewrite compileAll... utility methods diff --git a/libs/sysplugins/smarty_internal_compile_private_special_variable.php b/libs/sysplugins/smarty_internal_compile_private_special_variable.php index 42741408..96ffe0c8 100644 --- a/libs/sysplugins/smarty_internal_compile_private_special_variable.php +++ b/libs/sysplugins/smarty_internal_compile_private_special_variable.php @@ -67,7 +67,8 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C $compiler->trigger_template_error("(secure mode) super globals not permitted"); break; } - return '$_' . strtoupper($variable); + $compiled_ref = '$_' . strtoupper($variable); + break; break; case 'template': @@ -117,7 +118,13 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C $compiler->trigger_template_error('$smarty.' . trim($_index[0], "'") . ' is invalid'); break; } + if (isset($_index[1])) { + array_shift($_index); + foreach ($_index as $_ind) { + $compiled_ref = $compiled_ref . "[$_ind]"; + } + } + return $compiled_ref; } - return ''; } }