From 591dbcabe57a32550fb73223521fa1323773628f Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sun, 22 Feb 2015 20:22:47 +0000 Subject: Fix bug #64695 (JSON_NUMERIC_CHECK has issues with strings that are numbers plus the letter e) --- ext/json/json.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'ext/json/json.c') diff --git a/ext/json/json.c b/ext/json/json.c index 5b71eb06f6..16af796145 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -418,18 +418,14 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR if ((type = is_numeric_string(s, len, &p, &d, 0)) != 0) { if (type == IS_LONG) { smart_str_append_long(buf, p); - } else if (type == IS_DOUBLE) { - if (!zend_isinf(d) && !zend_isnan(d)) { - char *tmp; - int l = spprintf(&tmp, 0, "%.*k", (int) EG(precision), d); - smart_str_appendl(buf, tmp, l); - efree(tmp); - } else { - JSON_G(error_code) = PHP_JSON_ERROR_INF_OR_NAN; - smart_str_appendc(buf, '0'); - } + return; + } else if (type == IS_DOUBLE && !zend_isinf(d) && !zend_isnan(d)) { + char *tmp; + int l = spprintf(&tmp, 0, "%.*k", (int) EG(precision), d); + smart_str_appendl(buf, tmp, l); + efree(tmp); + return; } - return; } } -- cgit v1.2.1