You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2012/04/03 14:39:07 UTC
svn commit: r1308863 - in /httpd/httpd/branches/2.4.x: STATUS server/util.c
Author: jim
Date: Tue Apr 3 12:39:07 2012
New Revision: 1308863
URL: http://svn.apache.org/viewvc?rev=1308863&view=rev
Log:
Merge r1307067 from trunk:
Fix treatment of regex backreferences.
r904765 only made half of the necessary changes to remove the use
of '&' as an alias for '$0' and allow to escape any character with a
backslash.
Submitted by: sf
Reviewed/backported by: jim
Modified:
httpd/httpd/branches/2.4.x/STATUS
httpd/httpd/branches/2.4.x/server/util.c
Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1308863&r1=1308862&r2=1308863&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Tue Apr 3 12:39:07 2012
@@ -88,12 +88,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * core: Fix regexp substitution bug
- Trunk patch: http://svn.apache.org/viewvc?rev=1307067&view=rev
- 2.4.x patch: Trunk patch works, add CHANGES:
- core: Fix regular expression substitution if the replacment string
- contained '&' or '\'. (Bug introduced in 2.3.5).
- +1: sf, covener, jim
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
Modified: httpd/httpd/branches/2.4.x/server/util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/util.c?rev=1308863&r1=1308862&r2=1308863&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/util.c (original)
+++ httpd/httpd/branches/2.4.x/server/util.c Tue Apr 3 12:39:07 2012
@@ -437,15 +437,13 @@ static apr_status_t regsub_core(apr_pool
src = input;
while ((c = *src++) != '\0') {
- if (c == '&')
- no = 0;
- else if (c == '$' && apr_isdigit(*src))
+ if (c == '$' && apr_isdigit(*src))
no = *src++ - '0';
else
no = AP_MAX_REG_MATCH;
if (no >= AP_MAX_REG_MATCH) { /* Ordinary character. */
- if (c == '\\' && (*src == '$' || *src == '&'))
+ if (c == '\\' && *src)
c = *src++;
*dst++ = c;
}