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

index c130105ae81301c02fb53bb6887fffb610415fcf..0e3a02325113a76ebb0ac66c233e0381878eee89 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) {
                                                if (key[0] == '\0' && Z_TYPE_PP(val) == IS_OBJECT) {
                                                        /* Skip protected and private members. */
+                                                       if (tmp_ht) {
+                                                               tmp_ht->nApplyCount--;
+                                                       }
                                                        continue;
                                                }