diff --git a/NEWS b/NEWS index 8e075d7d..19e978c5 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - fix handling of $var.key inside [] (messju) - fix handling of assign inside {insert}-tags (messju) - fix handling if [...] inside triple-quotes in config-files (messju) - fix handling of simple-math-operators inside modifiers (Dominik, messju) diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index c1d2d0a9..3f20abd6 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -1674,7 +1674,11 @@ class Smarty_Compiler extends Smarty { if (is_numeric($_index)) { $_output .= "[$_index]"; } elseif ($_index{0} == '$') { - $_output .= "[\$this->_tpl_vars['" . substr($_index, 1) . "']]"; + if (strpos($_index, '.') !== false) { + $_output .= '[' . $this->_parse_var($_index) . ']'; + } else { + $_output .= "[\$this->_tpl_vars['" . substr($_index, 1) . "']]"; + } } else { $_var_parts = explode('.', $_index); $_var_section = $_var_parts[0];