cvs: php-src(PHP_4_3) / NEWS /ext/standard array.c

From: Date: Tue, 10 Aug 2004 06:04:12 +0000
Subject: cvs: php-src(PHP_4_3) / NEWS /ext/standard array.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-28243@lists.php.net to get a copy of this message
moriyoshi Tue Aug 10 02:04:12 2004 EDT Modified files: (Branch: PHP_4_3) /php-src NEWS /php-src/ext/standard array.c Log: - MFH: Bugfix #29493 (extract(array, EXTR_REFS) misbehaves with elements referred twice or more times) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.711&r2=1.1247.2.712&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1247.2.711 php-src/NEWS:1.1247.2.712 --- php-src/NEWS:1.1247.2.711 Mon Aug 9 20:44:26 2004 +++ php-src/NEWS Tue Aug 10 02:04:11 2004 @@ -5,6 +5,8 @@ - NSAPI: added "bucket" parameter to list of non-php.ini-keys of php4_execute for doing performance stats without warnings in server-log. (Uwe Schindler) - Fixed bug #29581 (Typo inside php.ini comments for mysql.trace_mode). (Ilia) +- Fixed bug #29493 (extract(array, EXTR_REFS) misbehaves with elements + referred twice or more times). (Moriyoshi) - Fixed bug #29443 (Sanity check for wbmp detection). (Ilia) - Fixed bug #29369 (Uploaded files with ' or " in their names get their names truncated at those characters). (Ilia) http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.199.2.35&r2=1.199.2.36&ty=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.199.2.35 php-src/ext/standard/array.c:1.199.2.36 --- php-src/ext/standard/array.c:1.199.2.35 Sun Jul 11 17:30:19 2004 +++ php-src/ext/standard/array.c Tue Aug 10 02:04:12 2004 @@ -22,7 +22,7 @@ */ -/* $Id: array.c,v 1.199.2.35 2004/07/11 21:30:19 andrey Exp $ */ +/* $Id: array.c,v 1.199.2.36 2004/08/10 06:04:12 moriyoshi Exp $ */ #include "php.h" #include "php_ini.h" @@ -1290,13 +1290,16 @@ if (extract_refs) { zval **orig_var; - SEPARATE_ZVAL_TO_MAKE_IS_REF(entry); - zval_add_ref(entry); - if (zend_hash_find(EG(active_symbol_table), final_name.c, final_name.len+1, (void **) &orig_var) == SUCCESS) { zval_ptr_dtor(orig_var); + + SEPARATE_ZVAL_TO_MAKE_IS_REF(entry); + zval_add_ref(entry); + *orig_var = *entry; } else { + (*entry)->is_ref = 1; + zval_add_ref(entry); zend_hash_update(EG(active_symbol_table), final_name.c, final_name.len+1, (void **) entry, sizeof(zval *), NULL); } } else {

« previous php.cvs (#28243) next »