fix handling of $var.key inside []

This commit is contained in:
messju
2003-11-13 16:51:47 +00:00
parent 7d391d55a8
commit 2ae14ea686
2 changed files with 6 additions and 1 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- fix handling of $var.key inside [] (messju)
- fix handling of assign inside {insert}-tags (messju) - fix handling of assign inside {insert}-tags (messju)
- fix handling if [...] inside triple-quotes in config-files (messju) - fix handling if [...] inside triple-quotes in config-files (messju)
- fix handling of simple-math-operators inside modifiers (Dominik, messju) - fix handling of simple-math-operators inside modifiers (Dominik, messju)

View File

@@ -1674,7 +1674,11 @@ class Smarty_Compiler extends Smarty {
if (is_numeric($_index)) { if (is_numeric($_index)) {
$_output .= "[$_index]"; $_output .= "[$_index]";
} elseif ($_index{0} == '$') { } elseif ($_index{0} == '$') {
if (strpos($_index, '.') !== false) {
$_output .= '[' . $this->_parse_var($_index) . ']';
} else {
$_output .= "[\$this->_tpl_vars['" . substr($_index, 1) . "']]"; $_output .= "[\$this->_tpl_vars['" . substr($_index, 1) . "']]";
}
} else { } else {
$_var_parts = explode('.', $_index); $_var_parts = explode('.', $_index);
$_var_section = $_var_parts[0]; $_var_section = $_var_parts[0];