]> granicus.if.org Git - php/commitdiff
MFB
authorIlia Alshanetsky <iliaa@php.net>
Mon, 26 May 2003 02:00:37 +0000 (02:00 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 26 May 2003 02:00:37 +0000 (02:00 +0000)
ext/pcre/php_pcre.c
ext/standard/string.c

index 6aefb0c05812c39e162209e51560f78521426c9f..4ed51c877e6229b80ced5b142eaafc6209e2f577 100644 (file)
@@ -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))
index fff25c077ead1f4b24f8e46a448d0b1300b9b12e..1d193768e323f16bd793d07ad0046c60cee69f5a 100644 (file)
@@ -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;