]> granicus.if.org Git - php/commitdiff
(PHP preg_replace) Fixed a bug that cause backreferences to lose
authorAndrei Zmievski <andrei@php.net>
Fri, 19 Nov 1999 22:59:12 +0000 (22:59 +0000)
committerAndrei Zmievski <andrei@php.net>
Fri, 19 Nov 1999 22:59:12 +0000 (22:59 +0000)
their value after the first occurrence.

ext/pcre/php_pcre.c

index 26a10991a3d55d11a39ad47e5630bd1034b9cf0d..22bc7638f328c85d888848435ef9b4d4550e736a 100644 (file)
@@ -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;