summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-05-26 02:00:37 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-05-26 02:00:37 +0000
commitbd955dcb81ad37fded6698b879075f92e3b25e1b (patch)
treed0fa633959a3eeac64414037f29244b369c85f6e
parent653717b72cf92ad41acafb63e0d6c3098ebe3dfa (diff)
downloadphp-git-bd955dcb81ad37fded6698b879075f92e3b25e1b.tar.gz
MFB
-rw-r--r--ext/pcre/php_pcre.c1
-rw-r--r--ext/standard/string.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 6aefb0c058..4ed51c877e 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1085,6 +1085,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))
diff --git a/ext/standard/string.c b/ext/standard/string.c
index fff25c077e..1d193768e3 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -2728,6 +2728,7 @@ PHP_FUNCTION(str_replace)
while (zend_hash_get_current_data(Z_ARRVAL_PP(subject), (void **)&subject_entry) == SUCCESS) {
if (Z_TYPE_PP(subject_entry) != IS_ARRAY && Z_TYPE_PP(subject_entry) != IS_OBJECT) {
MAKE_STD_ZVAL(result);
+ SEPARATE_ZVAL(subject_entry);
php_str_replace_in_subject(*search, *replace, subject_entry, result);
} else {
result = *subject_entry;