From 4df36948c865285c192af5c2772e9be02485cca7 Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Fri, 25 Aug 2000 13:51:07 +0000 Subject: [PATCH] @- 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. --- ext/pcre/php_pcre.c | 1 + 1 file changed, 1 insertion(+) 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); -- 2.50.1