diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-05-25 21:48:57 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-05-25 21:48:57 +0000 |
commit | 2e361db1febe3852268c3439242071e3b7ea8869 (patch) | |
tree | e96b85d83ebf240e03007b205b8b88831e862f5a /ext/pcre/php_pcre.c | |
parent | cf8a7bd2354c4f278ac4350b6d65b01cec807ed1 (diff) | |
download | php-git-2e361db1febe3852268c3439242071e3b7ea8869.tar.gz |
Fixed bug #23788 (str|preg_replace clober the array elements).
# Should this be MFBed to 4.3 branch?
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r-- | ext/pcre/php_pcre.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 7deb672a91..d669d0704a 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1082,6 +1082,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl /* For each subject entry, convert it to string, then perform replacement and add the result to the return_value array. */ while (zend_hash_get_current_data(Z_ARRVAL_PP(subject), (void **)&subject_entry) == SUCCESS) { + SEPARATE_ZVAL(subject_entry); if ((result = php_replace_in_subject(*regex, *replace, subject_entry, &result_len, limit_val, is_callable_replace TSRMLS_CC)) != NULL) { /* Add to return array */ switch(zend_hash_get_current_key(Z_ARRVAL_PP(subject), &string_key, &num_key, 0)) |