cvs: php-src /ext/standard array.c
| From: | Dmitry Stogov | Date: | Fri, 28 Oct 2005 09:57:51 +0000 |
| Subject: | cvs: php-src /ext/standard array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-34842@lists.php.net to get a copy of this message | ||
dmitry Fri Oct 28 05:57:51 2005 EDT
Modified files:
/php-src/ext/standard array.c
Log:
Fixed bug #34982 (array_walk_recursive() modifies elements outside function scope)
http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.330&r2=1.331&ty=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.330 php-src/ext/standard/array.c:1.331
--- php-src/ext/standard/array.c:1.330 Mon Oct 24 03:01:42 2005
+++ php-src/ext/standard/array.c Fri Oct 28 05:57:50 2005
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.330 2005/10/24 07:01:42 dmitry Exp $ */
+/* $Id: array.c,v 1.331 2005/10/28 09:57:50 dmitry Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -1091,7 +1091,8 @@
while (!EG(exception) && zend_hash_get_current_data_ex(target_hash, (void **)&args[0],
&pos) == SUCCESS) {
if (recursive && Z_TYPE_PP(args[0]) == IS_ARRAY) {
HashTable *thash;
-
+
+ SEPARATE_ZVAL_TO_MAKE_IS_REF(args[0]);
thash = HASH_OF(*(args[0]));
if (thash == target_hash) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");