fixed proper escaping for literal strings passed to

Smarty_Compiler::_expand_quoted_text() by
Smarty_Compiler::_parse_var_props()
This commit is contained in:
messju
2005-08-04 19:43:21 +00:00
parent f96326d4a9
commit 986640555a
2 changed files with 3 additions and 1 deletions

2
NEWS
View File

@@ -1,3 +1,5 @@
- fix proper escaping for literal strings in
Smarty_Compiler::_parse_var_props() (boots, messju)
- remove ambiguity for numeric values passed to smarty_make_timestamp() - remove ambiguity for numeric values passed to smarty_make_timestamp()
(and thus the date_format modifier). numeric values are treated as (and thus the date_format modifier). numeric values are treated as
timestamps now. (andreas, messju) timestamps now. (andreas, messju)

View File

@@ -1650,7 +1650,7 @@ class Smarty_Compiler extends Smarty {
} }
elseif(!in_array($val, $this->_permitted_tokens) && !is_numeric($val)) { elseif(!in_array($val, $this->_permitted_tokens) && !is_numeric($val)) {
// literal string // literal string
return $this->_expand_quoted_text('"' . $val .'"'); return $this->_expand_quoted_text('"' . strtr($val, array('\\' => '\\\\', '"' => '\\"')) .'"');
} }
return $val; return $val;
} }