From 604c7f6ad23019d59347ecc2a009681748fc541f Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Thu, 2 Oct 2008 03:36:20 +0000 Subject: [PATCH] - MFH: Fixed bug #46215 (json_encode mutates its parameter and has some class-specific state) --- ext/json/json.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/json/json.c b/ext/json/json.c index c130105ae8..0e3a023251 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -211,6 +211,9 @@ static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC) if (i == HASH_KEY_IS_STRING) { if (key[0] == '\0' && Z_TYPE_PP(val) == IS_OBJECT) { /* Skip protected and private members. */ + if (tmp_ht) { + tmp_ht->nApplyCount--; + } continue; } -- 2.40.0