append "@" to template var echoes to supress possible notices

This commit is contained in:
mohrt
2003-03-15 19:34:46 +00:00
parent 6f3de10273
commit e4f2f8cf35
2 changed files with 7 additions and 6 deletions

3
NEWS
View File

@@ -1,4 +1,5 @@
- append "@" to _run_mod_handler to supress warnings (Monte)
- append "@" to _run_mod_handler and template var echos to
supress possible warnings (Monte)
- fix problem with escaped double quotes (Monte)
- fix html_radios to not return an array (Monte)
- fixed length in modifier.truncate.php (messju)

View File

@@ -1498,10 +1498,10 @@ class Smarty_Compiler extends Smarty {
$output = $smarty_ref;
} else {
$var_name = substr(array_shift($indexes), 1);
$output = "\$this->_smarty_vars['$var_name']";
$output = "@\$this->_smarty_vars['$var_name']";
}
} else {
$output = "\$this->_tpl_vars['$var_name']";
$output = "@\$this->_tpl_vars['$var_name']";
}
foreach ($indexes as $index) {
@@ -1510,16 +1510,16 @@ class Smarty_Compiler extends Smarty {
if (is_numeric($index)) {
$output .= "[$index]";
} elseif ($index{0} == '$') {
$output .= "[\$this->_tpl_vars['" . substr($index, 1) . "']]";
$output .= "[@\$this->_tpl_vars['" . substr($index, 1) . "']]";
} else {
$parts = explode('.', $index);
$section = $parts[0];
$section_prop = isset($parts[1]) ? $parts[1] : 'index';
$output .= "[\$this->_sections['$section']['$section_prop']]";
$output .= "[@\$this->_sections['$section']['$section_prop']]";
}
} else if ($index{0} == '.') {
if ($index{1} == '$')
$output .= "[\$this->_tpl_vars['" . substr($index, 2) . "']]";
$output .= "[@\$this->_tpl_vars['" . substr($index, 2) . "']]";
else
$output .= "['" . substr($index, 1) . "']";
} else if (substr($index,0,2) == '->') {