sesser Fri Dec 3 11:04:10 2004 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/standard var_unserializer.c var_unserializer.re Log: MFH http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.38.2.2&r2=1.38.2.3&ty=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.38.2.2 php-src/ext/standard/var_unserializer.c:1.38.2.3 --- php-src/ext/standard/var_unserializer.c:1.38.2.2 Wed Dec 1 17:42:14 2004 +++ php-src/ext/standard/var_unserializer.c Fri Dec 3 11:04:10 2004 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var_unserializer.c,v 1.38.2.2 2004/12/01 22:42:14 sesser Exp $ */ +/* $Id: var_unserializer.c,v 1.38.2.3 2004/12/03 16:04:10 sesser Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -205,9 +205,15 @@ 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 @@ 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); http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.27.2.2&r2=1.27.2.3&ty=u Index: php-src/ext/standard/var_unserializer.re diff -u php-src/ext/standard/var_unserializer.re:1.27.2.2 php-src/ext/standard/var_unserializer.re:1.27.2.3 --- php-src/ext/standard/var_unserializer.re:1.27.2.2 Wed Dec 1 17:42:14 2004 +++ php-src/ext/standard/var_unserializer.re Fri Dec 3 11:04:10 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var_unserializer.re,v 1.27.2.2 2004/12/01 22:42:14 sesser Exp $ */ +/* $Id: var_unserializer.re,v 1.27.2.3 2004/12/03 16:04:10 sesser Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -208,9 +208,15 @@ 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 @@ 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);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php