This should fix the implode() problem
authorZeev Suraski <zeev@php.net>
Fri, 30 Jul 1999 22:17:51 +0000 (22:17 +0000)
committerZeev Suraski <zeev@php.net>
Fri, 30 Jul 1999 22:17:51 +0000 (22:17 +0000)
ChangeLog
ext/standard/string.c

index 805164d1422f07c07b81ebaff3a507695a7c8eb8..2adf74db2e4140a58db0d894dbc0b1f3145e1eb8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@ PHP 4.0 CHANGE LOG                                                    ChangeLog
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 ??? ?? 1999, Version 4.0 Beta 2
+- Fixed a bug in implode() that caused it to corrupt its arguments (Zeev)
 - Added get_class($obj), get_parent_class($obj) and method_exists($obj,"name")
   (Andi & Zeev)
 - Fixed various inheritance problems (Andi & Zeev, libzend)
index 1d1717fc362023090a5d5012f405017e1e4b698d..7be2b0317bdbf92b58f56751fb8dcc12dafeabaa 100644 (file)
@@ -304,6 +304,7 @@ void _php3_implode(pval *delim, pval *arr, pval *return_value)
        /* convert everything to strings, and calculate length */
        _php3_hash_internal_pointer_reset(arr->value.ht);
        while (_php3_hash_get_current_data(arr->value.ht, (void **) &tmp) == SUCCESS) {
+               SEPARATE_ZVAL(tmp);
                convert_to_string(*tmp);
                if ((*tmp)->type == IS_STRING && (*tmp)->value.str.val != undefined_variable_string) {
                        len += (*tmp)->value.str.len;