mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
append "@" to template var echoes to supress possible notices
This commit is contained in:
3
NEWS
3
NEWS
@@ -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)
|
||||||
|
@@ -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) == '->') {
|
||||||
|
Reference in New Issue
Block a user