diff options
author | Dmitry Stogov <dmitry@php.net> | 2005-10-28 09:57:35 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2005-10-28 09:57:35 +0000 |
commit | fa406902d5a4bd3f50d29c3e3cff723e18492c2f (patch) | |
tree | 42304c969256c8754f7ea159c167c365c4d2a5c2 | |
parent | 36a14076a8902fafd355a3ad15d64a96d4bb4e31 (diff) | |
download | php-git-fa406902d5a4bd3f50d29c3e3cff723e18492c2f.tar.gz |
Fixed bug #34982 (array_walk_recursive() modifies elements outside function scope)
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | ext/standard/array.c | 1 |
2 files changed, 3 insertions, 0 deletions
@@ -4,6 +4,8 @@ PHP NEWS - Fixed fgetcsv() and fputcsv() inconsistency. (Dmitry) - Fixed bug #34996 (ImageTrueColorToPalette() crashes when ncolors is zero). (Tony) +- Fixed bug #34982 (array_walk_recursive() modifies elements outside function + scope). (Dmitry) - Fixed bug #34977 (Compile failure on MacOSX due to use of varargs.h). (Tony) - Fixed bug #34968 (bz2 extension fails on to build on some win32 setups). (Ilia) diff --git a/ext/standard/array.c b/ext/standard/array.c index fd9f2af36f..bbb4e958bd 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1072,6 +1072,7 @@ static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive 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"); |