php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | |
Patch return_string_instead_of_warning for JSON related Bug #64695Patch version 2013-04-23 06:27 UTC Return to Bug #64695 | Download this patchThis patch renders other patches obsolete Obsolete patches:
Developer: keith@openx.comdiff --git a/ext/json/json.c b/ext/json/json.c index ad8d08c..97aee01 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -295,18 +295,16 @@ 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); + return; } 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 { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "double %.9g does not conform to the JSON spec, encoded as 0", d); - smart_str_appendc(buf, '0'); + return; } } - return; } } |
Copyright © 2001-2024 The PHP Group All rights reserved. |
Last updated: Mon Sep 09 09:01:27 2024 UTC |