mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 11:54:26 +02:00
fixed proper escaping for literal strings passed to
Smarty_Compiler::_expand_quoted_text() by Smarty_Compiler::_parse_var_props()
This commit is contained in:
2
NEWS
2
NEWS
@@ -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)
|
||||||
|
@@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user