From 41ec253ac809f45e2c6728da9b7b5b4967058162 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Fri, 8 Jun 2007 08:57:21 +0000 Subject: [PATCH] oops, empty properties are not allowed --- ext/json/JSON_parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/json/JSON_parser.c b/ext/json/JSON_parser.c index 36298fbbc5..3e091864f9 100644 --- a/ext/json/JSON_parser.c +++ b/ext/json/JSON_parser.c @@ -357,7 +357,7 @@ static void attach_zval(json_parser *json, int up, int cur, smart_str *key, int { if (!assoc) { - add_utf8_property_zval_ex(root, (key->len ? key->c : ""), (key->len ? (key->len + 1) : sizeof("")), child TSRMLS_CC); + add_utf8_property_zval_ex(root, (key->len ? key->c : "_empty_"), (key->len ? (key->len + 1) : sizeof("_empty_")), child TSRMLS_CC); #if PHP_MAJOR_VERSION >= 5 ZVAL_DELREF(child); #endif @@ -500,7 +500,7 @@ JSON_parser(zval *z, unsigned short p[], int length, int assoc TSRMLS_DC) if (!assoc) { - add_utf8_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : ""), (key.len ? (key.len + 1) : sizeof("")), mval TSRMLS_CC); + add_utf8_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : "_empty_"), (key.len ? (key.len + 1) : sizeof("_empty_")), mval TSRMLS_CC); #if PHP_MAJOR_VERSION >= 5 ZVAL_DELREF(mval); #endif @@ -631,7 +631,7 @@ JSON_parser(zval *z, unsigned short p[], int length, int assoc TSRMLS_DC) { if (!assoc) { - add_utf8_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : ""), (key.len ? (key.len + 1) : sizeof("")), mval TSRMLS_CC); + add_utf8_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : "_empty_"), (key.len ? (key.len + 1) : sizeof("_empty_")), mval TSRMLS_CC); #if PHP_MAJOR_VERSION >= 5 ZVAL_DELREF(mval); #endif -- 2.50.1