]> granicus.if.org Git - apache/commitdiff
mod_rewrite: PR58854: Revert r1726016 (rewrite looping issue) which was
authorEric Covener <covener@apache.org>
Wed, 9 Mar 2016 15:10:55 +0000 (15:10 +0000)
committerEric Covener <covener@apache.org>
Wed, 9 Mar 2016 15:10:55 +0000 (15:10 +0000)
reverted in trunk in r1732896. The fix is bad and breaks old loop
avoidance.

Reviewed By: covener, ylavic, jim

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

CHANGES
STATUS
modules/mappers/mod_rewrite.c

diff --git a/CHANGES b/CHANGES
index 7c5beb59e07395c9e93fa1d07ab98d0bf8bbd07e..3765e5d0564240abd4a93215260cfaa9ea11cd86 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -120,10 +120,6 @@ Changes with Apache 2.4.19
      is now logged at TRACE1 level to match the underlying core output filter
      severity.  [Eric Covener]
 
-  *) mod_rewrite: Avoid looping on relative substitutions that
-     result in the same filename we started with. PR 58854.
-     [Eric Covener]
-
   *) mime.types: add common extension "m4a" for MPEG 4 Audio.
      PR 57895 [Dylan Millikin <dylan.millikin gmail.com>]
 
diff --git a/STATUS b/STATUS
index f7630d566ca0dadb5eb62177051b3189b6b9ce74..95a3a1fecebc914f7be857d5fc1ab5d408c84710 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -129,11 +129,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      2.4.x patch: trunk patch works (modulo CHANGES)
      +1: minfrin, jim, ylavic
 
-  *) mod_rewrite: PR58854: Revert r1726016 (rewrite looping issue) which was
-     reverted in trunk in r1732896. The fix is bad and breaks old loop
-     avoidance.
-     +1 covener, jim, ylavic
-
   *) mod_rewrite: Add QSL flag as a way to allow rewrites to files with question
                   marks in their names. PR58777
      trunk patch: http://svn.apache.org/r1734125
index ddc2904b7ff0e4363d01c117992242c4b9d15932..c8667bfff6ad8fcd4b357114817b8443c9ac62b4 100644 (file)
@@ -5010,6 +5010,19 @@ static int hook_fixup(request_rec *r)
                 return HTTP_BAD_REQUEST;
             }
 
+            /* Check for deadlooping:
+             * At this point we KNOW that at least one rewriting
+             * rule was applied, but when the resulting URL is
+             * the same as the initial URL, we are not allowed to
+             * use the following internal redirection stuff because
+             * this would lead to a deadloop.
+             */
+            if (ofilename != NULL && strcmp(r->filename, ofilename) == 0) {
+                rewritelog((r, 1, dconf->directory, "initial URL equal rewritten"
+                            " URL: %s [IGNORING REWRITE]", r->filename));
+                return OK;
+            }
+
             tmpfilename = r->filename;
 
             /* if there is a valid base-URL then substitute
@@ -5070,20 +5083,6 @@ static int hook_fixup(request_rec *r)
                 }
             }
 
-            /* Check for deadlooping:
-             * At this point we KNOW that at least one rewriting
-             * rule was applied, but when the resulting URL is
-             * the same as the initial URL, we are not allowed to
-             * use the following internal redirection stuff because
-             * this would lead to a deadloop.
-             */
-            if (ofilename != NULL && strcmp(r->filename, ofilename) == 0) {
-                rewritelog((r, 1, dconf->directory, "initial URL equal rewritten"
-                            " URL: %s [IGNORING REWRITE]", r->filename));
-                return OK;
-            }
-
-
             /* now initiate the internal redirect */
             rewritelog((r, 1, dconf->directory, "internal redirect with %s "
                         "[INTERNAL REDIRECT]", r->filename));