summaryrefslogtreecommitdiff
path: root/ext/json/JSON_parser.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2007-05-27 16:31:35 +0000
committerIlia Alshanetsky <iliaa@php.net>2007-05-27 16:31:35 +0000
commitfaae3e9ecf55bbdb2d0f217016e8b59114b58f4c (patch)
tree8795d04ac96b84c2243736ae385579268131b0e6 /ext/json/JSON_parser.c
parent2c5368c013f287ed8bc88ecd52c0350f420c9738 (diff)
downloadphp-git-faae3e9ecf55bbdb2d0f217016e8b59114b58f4c.tar.gz
Fixed bug #41504 (json_decode() incorrectly decodes JSON arrays with empty
string keys).
Diffstat (limited to 'ext/json/JSON_parser.c')
-rw-r--r--ext/json/JSON_parser.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/json/JSON_parser.c b/ext/json/JSON_parser.c
index 91f565e033..2f2d268125 100644
--- a/ext/json/JSON_parser.c
+++ b/ext/json/JSON_parser.c
@@ -364,7 +364,7 @@ static void attach_zval(json_parser *json, int up, int cur, smart_str *key, int
}
else
{
- add_assoc_zval_ex(root, (key->len ? key->c : "_empty_"), (key->len ? (key->len + 1) : sizeof("_empty_")), child);
+ add_assoc_zval_ex(root, (key->len ? key->c : ""), (key->len ? (key->len + 1) : sizeof("")), child);
}
key->len = 0;
}
@@ -507,7 +507,7 @@ JSON_parser(zval *z, unsigned short p[], int length, int assoc TSRMLS_DC)
}
else
{
- add_assoc_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : "_empty_"), (key.len ? (key.len + 1) : sizeof("_empty_")), mval);
+ add_assoc_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : ""), (key.len ? (key.len + 1) : sizeof("")), mval);
}
key.len = 0;
buf.len = 0;
@@ -638,7 +638,7 @@ JSON_parser(zval *z, unsigned short p[], int length, int assoc TSRMLS_DC)
}
else
{
- add_assoc_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : "_empty_"), (key.len ? (key.len + 1) : sizeof("_empty_")), mval);
+ add_assoc_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : ""), (key.len ? (key.len + 1) : sizeof("")), mval);
}
key.len = 0;
}