]> granicus.if.org Git - php/commitdiff
- Fixed bug #46215 (json_encode mutates its parameter and has some class-specific...
authorFelipe Pena <felipe@php.net>
Thu, 2 Oct 2008 03:30:54 +0000 (03:30 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 2 Oct 2008 03:30:54 +0000 (03:30 +0000)
ext/json/json.c

index 9f86daa0040500e1de6979a478aa1652acb876d1..1d19d20deb9034f5be5abc889f23df5c77ac5551 100644 (file)
@@ -211,6 +211,9 @@ static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC)
                                        if (i == HASH_KEY_IS_STRING || i == HASH_KEY_IS_UNICODE) {
                                                if (key.s[0] == '\0' && Z_TYPE_PP(val) == IS_OBJECT) {
                                                        /* Skip protected and private members. */
+                                                       if (tmp_ht) {
+                                                               tmp_ht->nApplyCount--;
+                                                       }
                                                        continue;
                                                }