|
|
|
@ -700,13 +700,27 @@ static void php_wddx_add_var(wddx_packet *packet, zval *name_var) |
|
|
|
php_wddx_serialize_var(packet, *val, Z_STRVAL_P(name_var), Z_STRLEN_P(name_var) TSRMLS_CC); |
|
|
|
} |
|
|
|
} else if (Z_TYPE_P(name_var) == IS_ARRAY || Z_TYPE_P(name_var) == IS_OBJECT) { |
|
|
|
int is_array = Z_TYPE_P(name_var) == IS_ARRAY; |
|
|
|
|
|
|
|
target_hash = HASH_OF(name_var); |
|
|
|
|
|
|
|
if (is_array && target_hash->nApplyCount > 1) { |
|
|
|
php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
zend_hash_internal_pointer_reset(target_hash); |
|
|
|
|
|
|
|
while(zend_hash_get_current_data(target_hash, (void**)&val) == SUCCESS) { |
|
|
|
if (is_array) { |
|
|
|
target_hash->nApplyCount++; |
|
|
|
} |
|
|
|
|
|
|
|
php_wddx_add_var(packet, *val); |
|
|
|
|
|
|
|
|
|
|
|
if (is_array) { |
|
|
|
target_hash->nApplyCount--; |
|
|
|
} |
|
|
|
zend_hash_move_forward(target_hash); |
|
|
|
} |
|
|
|
} |
|
|
|
|