cvs: php-src(PHP_5_3) /ext/json json.c
| From: | Scott MacVicar | Date: | Wed, 24 Dec 2008 18:09:09 +0000 |
| Subject: | cvs: php-src(PHP_5_3) /ext/json json.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-55096@lists.php.net to get a copy of this message | ||
scottmac Wed Dec 24 18:09:09 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/json json.c
Log:
MFH Make sure we clear out the error when the scalar version decoding works.
http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.9.2.19.2.15&r2=1.9.2.19.2.16&diff_format=u
Index: php-src/ext/json/json.c
diff -u php-src/ext/json/json.c:1.9.2.19.2.15 php-src/ext/json/json.c:1.9.2.19.2.16
--- php-src/ext/json/json.c:1.9.2.19.2.15 Fri Dec 19 02:00:57 2008
+++ php-src/ext/json/json.c Wed Dec 24 18:09:09 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: json.c,v 1.9.2.19.2.15 2008/12/19 02:00:57 scottmac Exp $ */
+/* $Id: json.c,v 1.9.2.19.2.16 2008/12/24 18:09:09 scottmac Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -531,6 +531,8 @@
RETVAL_NULL();
if (str_len == 4) {
if (!strcasecmp(str, "null")) {
+ /* We need to explicitly clear the error because its an actual NULL and not an error */
+ jp->error_code = PHP_JSON_ERROR_NONE;
RETVAL_NULL();
} else if (!strcasecmp(str, "true")) {
RETVAL_BOOL(1);
@@ -547,6 +549,10 @@
}
}
+ if (Z_TYPE_P(return_value) != IS_NULL) {
+ jp->error_code = PHP_JSON_ERROR_NONE;
+ }
+
zval_dtor(z);
}
FREE_ZVAL(z);