]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) mod_rewrite: Catch an edge case, where strange subsequent RewriteRules
authorPaul J. Reder <rederpj@apache.org>
Wed, 4 Feb 2004 15:57:36 +0000 (15:57 +0000)
committerPaul J. Reder <rederpj@apache.org>
Wed, 4 Feb 2004 15:57:36 +0000 (15:57 +0000)
   could lead to a 400 (Bad Request) response.

Submitted by: Andr�� Malo
Reviewed by: jerenkrantz, rederpj

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

CHANGES
STATUS
modules/mappers/mod_rewrite.c

diff --git a/CHANGES b/CHANGES
index f63b7bc169f14ad21d1a4281de78d90c3e0303f6..f030a51cc2f91b8cbc1ed20fba57d9ad34d288f9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.49
 
+  *) mod_rewrite: Catch an edge case, where strange subsequent RewriteRules
+     could lead to a 400 (Bad Request) response.  [André Malo]
+
   *) Keep focus of ITERATE and ITERATE2 on the current module when
      the module chooses to return DECLINE_CMD for the directive.
      PR 22299.  [Geoffrey Young <geoff apache.org>]
diff --git a/STATUS b/STATUS
index c8a646d5310727387adb35d43cef0d2e74c6371d..78871f47f8011a46ea54bd6687facb9fad7f97e4 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2004/02/04 15:09:31 $]
+Last modified at [$Date: 2004/02/04 15:57:35 $]
 
 Release:
 
@@ -210,11 +210,6 @@ PATCHES TO BACKPORT FROM 2.1
       PREREQ: Blow away of SSL_EXPERIMENTAL_ENGINE (see above)
       +1: jwoolley, trawick, jim, jerenkrantz
 
-    * Catch an edge case, where strange subsequent RewriteRules could lead to
-      a 400 (Bad Request) response. (2.0 + 1.3)
-        modules/mappers/mod_rewrite.c: r1.228
-      +1: nd, jerenkrantz
-
     * mod_include's expression tokenizer: don't skip the first character of
       a string, it may be a backslash. (2.0 + 1.3)
       (patch for 2.0: http://cvs.apache.org/~nd/ssi-escape.patch)
index 0b3ad660f90a0d39ecabda0f056fe9a8a877f8ce..d4bee70ae20f0f9e4e95a36db00a740382443c56 100644 (file)
@@ -1943,7 +1943,6 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p,
     regmatch_t regmatch[AP_MAX_REG_MATCH];
     backrefinfo *briRR = NULL;
     backrefinfo *briRC = NULL;
-    int prefixstrip;
     int failed;
     apr_array_header_t *rewriteconds;
     rewritecond_entry *conds;
@@ -1974,14 +1973,12 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p,
      *  the local part.  Additionally indicate this special
      *  threatment in the logfile.
      */
-    prefixstrip = 0;
-    if (perdir != NULL) {
+    if (perdir) {
         if (   strlen(uri) >= strlen(perdir)
             && strncmp(uri, perdir, strlen(perdir)) == 0) {
             rewritelog(r, 3, "[per-dir %s] strip per-dir prefix: %s -> %s",
                        perdir, uri, uri+strlen(perdir));
             uri = uri+strlen(perdir);
-            prefixstrip = 1;
         }
     }
 
@@ -2177,8 +2174,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p,
      *   location, i.e. if it's not an absolute URL (!) path nor
      *   a fully qualified URL scheme.
      */
-    if (prefixstrip && *r->filename != '/'
-                    && !is_absolute_uri(r->filename)) {
+    if (perdir && *r->filename != '/' && !is_absolute_uri(r->filename)) {
         rewritelog(r, 3, "[per-dir %s] add per-dir prefix: %s -> %s%s",
                    perdir, r->filename, perdir, r->filename);
         r->filename = apr_pstrcat(r->pool, perdir, r->filename, NULL);