summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>1999-11-19 22:59:12 +0000
committerAndrei Zmievski <andrei@php.net>1999-11-19 22:59:12 +0000
commit3ae0f5fdc46b5e963c7f88dd6ee9ca4ea101d818 (patch)
treed53f36f846bbde45e1be17661752ea0f5db7825e
parent71a8c018cbf83b1b9d72afb43cef0d2633412737 (diff)
downloadphp-git-3ae0f5fdc46b5e963c7f88dd6ee9ca4ea101d818.tar.gz
(PHP preg_replace) Fixed a bug that cause backreferences to lose
their value after the first occurrence.
-rw-r--r--ext/pcre/php_pcre.c2
1 files changed, 1 insertions, 1 deletions
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;