diff --git a/NEWS b/NEWS index 9f3854af..eb1c053d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - name=123 is passed as an integer (not a string) to plugins now (messju) - $length is now propagated to sub-values in debug_print_var (messju) Version 2.5.0-RC2 (March 26, 2003) diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index b561f18e..f8c5c9ea 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -1354,6 +1354,8 @@ class Smarty_Compiler extends Smarty { $token = 'false'; } else if ($token == 'null') { $token = 'null'; + } else if (preg_match('!^-?[0-9]+$!', $token)) { + /* treat integer literally */ } else if (!preg_match('!^' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '(?:' . $this->_mod_regexp . ')*$!', $token)) { /* treat as a string, double-quote it escaping quotes */ $token = '"'.addslashes($token).'"';