|
|
@ -1001,18 +1001,11 @@ static void php_var_serialize_nested_data(smart_str *buf, zval *struc, HashTable |
|
|
/* we should still add element even if it's not OK, |
|
|
/* we should still add element even if it's not OK, |
|
|
* since we already wrote the length of the array before */ |
|
|
* since we already wrote the length of the array before */ |
|
|
if (Z_TYPE_P(data) == IS_ARRAY) { |
|
|
if (Z_TYPE_P(data) == IS_ARRAY) { |
|
|
if (UNEXPECTED(Z_IS_RECURSIVE_P(data)) |
|
|
|
|
|
|| UNEXPECTED(Z_TYPE_P(struc) == IS_ARRAY && Z_ARR_P(data) == Z_ARR_P(struc))) { |
|
|
|
|
|
|
|
|
if (UNEXPECTED(Z_TYPE_P(struc) == IS_ARRAY && Z_ARR_P(data) == Z_ARR_P(struc))) { |
|
|
php_add_var_hash(var_hash, struc, in_rcn_array); |
|
|
php_add_var_hash(var_hash, struc, in_rcn_array); |
|
|
smart_str_appendl(buf, "N;", 2); |
|
|
smart_str_appendl(buf, "N;", 2); |
|
|
} else { |
|
|
} else { |
|
|
if (Z_REFCOUNTED_P(data)) { |
|
|
|
|
|
Z_PROTECT_RECURSION_P(data); |
|
|
|
|
|
} |
|
|
|
|
|
php_var_serialize_intern(buf, data, var_hash, in_rcn_array, false); |
|
|
php_var_serialize_intern(buf, data, var_hash, in_rcn_array, false); |
|
|
if (Z_REFCOUNTED_P(data)) { |
|
|
|
|
|
Z_UNPROTECT_RECURSION_P(data); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
php_var_serialize_intern(buf, data, var_hash, in_rcn_array, false); |
|
|
php_var_serialize_intern(buf, data, var_hash, in_rcn_array, false); |
|
|
|