1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 05:32:28 +02:00
This commit is contained in:
Stefan Esser
2004-12-03 16:04:10 +00:00
parent a718d62f74
commit cd385539a3
2 changed files with 16 additions and 0 deletions

View File

@@ -205,9 +205,15 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, int
switch (Z_TYPE_P(key)) {
case IS_LONG:
if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)) {
var_replace(var_hash, old_data, rval);
}
zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL);
break;
case IS_STRING:
if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)) {
var_replace(var_hash, old_data, rval);
}
zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL);
break;
}
@@ -947,6 +953,8 @@ yy86:
if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) {
return 0;
}
if (*rval == *rval_ref) return 0;
if (*rval != NULL) {
zval_ptr_dtor(rval);

View File

@@ -208,9 +208,15 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, int
switch (Z_TYPE_P(key)) {
case IS_LONG:
if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)) {
var_replace(var_hash, old_data, rval);
}
zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL);
break;
case IS_STRING:
if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)) {
var_replace(var_hash, old_data, rval);
}
zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL);
break;
}
@@ -320,6 +326,8 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) {
return 0;
}
if (*rval == *rval_ref) return 0;
if (*rval != NULL) {
zval_ptr_dtor(rval);