]> granicus.if.org Git - php/commitdiff
@- Fixed a bug in preg_replace() that would truncate subject string if the
authorAndrei Zmievski <andrei@php.net>
Fri, 25 Aug 2000 13:51:07 +0000 (13:51 +0000)
committerAndrei Zmievski <andrei@php.net>
Fri, 25 Aug 2000 13:51:07 +0000 (13:51 +0000)
@  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

index 7c6f75b47754341ff3fff122c3880b614b896e6e..6a5a74de9ca33ed886137975d04c3d88b4c005be 100644 (file)
@@ -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);