]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Fix treatment of regex backreferences.
authorStefan Fritsch <sf@apache.org>
Thu, 29 Mar 2012 19:24:04 +0000 (19:24 +0000)
committerStefan Fritsch <sf@apache.org>
Thu, 29 Mar 2012 19:24:04 +0000 (19:24 +0000)
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.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1307067 13f79535-47bb-0310-9956-ffa450edef68

server/util.c

index 3c38fa9008666250bfab46f78c359a53157df18e..177f3780fc0aa83a9f94d1d87724a4d15e9e8059 100644 (file)
@@ -437,15 +437,13 @@ static apr_status_t regsub_core(apr_pool_t *p, char **result,
     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;
         }