From 3ae0f5fdc46b5e963c7f88dd6ee9ca4ea101d818 Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Fri, 19 Nov 1999 22:59:12 +0000 Subject: [PATCH] (PHP preg_replace) Fixed a bug that cause backreferences to lose their value after the first occurrence. --- ext/pcre/php_pcre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 26a10991a3..22bc7638f3 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -719,7 +719,7 @@ char *_php_pcre_replace(char *regex, char *subject, char *replace) backref < count) { match_len = offsets[(backref<<1)+1] - offsets[backref<<1]; memcpy (walkbuf, - piece + offsets[backref<<1], + subject + offsets[backref<<1], match_len); walkbuf += match_len; walk += (backref > 9) ? 3 : 2; -- 2.49.0