From: Andrei Zmievski Date: Fri, 25 Aug 2000 13:51:07 +0000 (+0000) Subject: @- Fixed a bug in preg_replace() that would truncate subject string if the X-Git-Tag: php-4.0.2~66 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4df36948c865285c192af5c2772e9be02485cca7;p=php @- Fixed a bug in preg_replace() that would truncate subject string if the @ first argument was en empty array. (Andrei) This fixes bug #6346, that would truncate subject string if the first argument was en empty array. --- diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 7c6f75b477..6a5a74de9c 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -786,6 +786,7 @@ static char *php_replace_in_subject(zval *regex, zval *replace, zval **subject, /* Duplicate subject string for repeated replacement */ subject_value = estrndup((*subject)->value.str.val, (*subject)->value.str.len); subject_len = (*subject)->value.str.len; + *result_len = subject_len; zend_hash_internal_pointer_reset(regex->value.ht);