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 problem with escaped double quotes (Monte)
- fix html_radios to not return an array (Monte) - fix html_radios to not return an array (Monte)
- fixed length in modifier.truncate.php (messju) - fixed length in modifier.truncate.php (messju)

View File

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