diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6e92f57 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +tags diff --git a/jzon.inc.php b/jzon.inc.php index 3a027fe..29efc35 100644 --- a/jzon.inc.php +++ b/jzon.inc.php @@ -290,10 +290,11 @@ class jzonParser ++$this->c; } + $str_num = substr($this->in, $start, $this->c - $start); if($is_float) - $out = 1*substr($this->in, $start, $this->c - $start); + $out = floatval($str_num); else - $out = (int)(1*substr($this->in, $start, $this->c - $start)); + $out = intval($str_num); } private function parse_true(&$out) @@ -340,7 +341,7 @@ function jzon_parse($str) return $res; //NOTE: only allowing extension implementation if versions match - if(JZON_EXT_VERSION === JZON_VERSION) + if(defined('JZON_EXT_VERSION') && JZON_EXT_VERSION === JZON_VERSION) { list($ok, $err, $err_pos, $res) = jzon_parse_c($str); if(!$ok)