Please add a regression test for this bug.
    
    --Jani

On Fri, 26 Sep 2003, Sara Golemon wrote:

>pollita                Fri Sep 26 13:57:13 2003 EDT
>
>  Modified files:              
>    /php-src/ext/standard      string.c 
>  Log:
>  Bug Fix#25671  Corruption in subarrays in subject when using str_replace
>  
>Index: php-src/ext/standard/string.c
>diff -u php-src/ext/standard/string.c:1.397 php-src/ext/standard/string.c:1.398
>--- php-src/ext/standard/string.c:1.397        Sat Sep 20 12:10:49 2003
>+++ php-src/ext/standard/string.c      Fri Sep 26 13:57:13 2003
>@@ -18,7 +18,7 @@
>    +----------------------------------------------------------------------+
>  */
> 
>-/* $Id: string.c,v 1.397 2003/09/20 16:10:49 sas Exp $ */
>+/* $Id: string.c,v 1.398 2003/09/26 17:57:13 pollita Exp $ */
> 
> /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
> 
>@@ -3192,7 +3192,10 @@
>                               SEPARATE_ZVAL(subject_entry);
>                               php_str_replace_in_subject(*search, *replace, 
> subject_entry, result, case_sensitivity, (argc > 3) ? &count : NULL);
>                       } 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,
>
>

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

Reply via email to