Skip to content

Commit

Permalink
MFH BugFix# 25671 subarray corruption in str_replace
Browse files Browse the repository at this point in the history
  • Loading branch information
sgolemon committed Sep 26, 2003
1 parent 18557cb commit de85bcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -7,6 +7,7 @@ PHP 4 NEWS
- 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)
Expand Down
5 changes: 4 additions & 1 deletion ext/standard/string.c
Expand Up @@ -2746,7 +2746,10 @@ PHP_FUNCTION(str_replace)
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,
Expand Down

0 comments on commit de85bcc

Please sign in to comment.