pollita         Fri Sep 26 14:00:01 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php-src/ext/standard       string.c 
    /php-src    NEWS 
  Log:
  MFH BugFix# 25671 subarray corruption in str_replace
  
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.333.2.34 
php-src/ext/standard/string.c:1.333.2.35
--- php-src/ext/standard/string.c:1.333.2.34    Sat Sep 20 12:09:41 2003
+++ php-src/ext/standard/string.c       Fri Sep 26 13:59:59 2003
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.333.2.34 2003/09/20 16:09:41 sas Exp $ */
+/* $Id: string.c,v 1.333.2.35 2003/09/26 17:59:59 pollita Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -2746,7 +2746,10 @@
                                SEPARATE_ZVAL(subject_entry);
                                php_str_replace_in_subject(*search, *replace, 
subject_entry, result);
                        } else {
-                               result = *subject_entry;
+                               MAKE_STD_ZVAL(result);
+                               SEPARATE_ZVAL(subject_entry);
+                               *result = **subject_entry;
+                               zval_copy_ctor(result);
                        }
                        /* Add to return array */
                        switch (zend_hash_get_current_key_ex(Z_ARRVAL_PP(subject), 
&string_key,
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.409 php-src/NEWS:1.1247.2.410
--- php-src/NEWS:1.1247.2.409   Wed Sep 24 19:39:22 2003
+++ php-src/NEWS        Fri Sep 26 14:00:00 2003
@@ -7,6 +7,7 @@
 - Fixed crash bug when non-existing save/serializer handler was used. (Jani)
 - Fixed memory leak in gethostbynamel() if an error occurs. (Sara)
 - Fixed FastCGI being unable to bind to a specific IP. (Sascha)
+- Fixed bug #25671 (str_replace corrupting subarrays). (Sara)
 - Fixed bug #25648 (xslt_set_encoding() being not detected correctly). (Jani)
 - Fixed bug #25636 (SNMP Session not closed on success). (Ilia, 
   nesslage[at]mwsc[dot]edu)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to