httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r1410681 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_rewrite.xml modules/mappers/mod_rewrite.c
Date Sat, 17 Nov 2012 02:59:32 GMT
Author: covener
Date: Sat Nov 17 02:59:31 2012
New Revision: 1410681

URL: http://svn.apache.org/viewvc?rev=1410681&view=rev
Log:
PR53963: don't merge the rewritebase down w/o an opt-in

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml
    httpd/httpd/trunk/modules/mappers/mod_rewrite.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1410681&r1=1410680&r2=1410681&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat Nov 17 02:59:31 2012
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_rewrite: Stop mergeing RewriteBase down to subdirectories
+     unless new option 'RewriteOptions MergeBase' is configured.
+     PR 53963. [Eric Covener]
+
   *) mod_session_dbd: fix a segmentation fault in the function dbd_remove.
     PR 53452. [<rebanerebane gmail com>, Reimo Rebane]
   

Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml?rev=1410681&r1=1410680&r2=1410681&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml Sat Nov 17 02:59:31 2012
@@ -220,6 +220,15 @@ later</compatibility>
       </note>
       </dd>
 
+      <dt><code>MergeBase</code></dt>
+      <dd>
+
+      <p>With this option, the value of <directive module="mod_rewrite"
+      >RewriteBase</directive> is copied from where it's explicitly defined
+      into any sub-directory or sub-location that doesn't define its own
+      <directive module="mod_rewrite">RewriteBase</directive>. Available in 
+      Apache HTTP Server 2.5 and later only.</p>
+      </dd>
       </dl>
 
 </usage>

Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?rev=1410681&r1=1410680&r2=1410681&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Sat Nov 17 02:59:31 2012
@@ -191,6 +191,7 @@ static const char* really_last_key = "re
 #define OPTION_INHERIT_BEFORE       1<<2
 #define OPTION_NOSLASH              1<<3
 #define OPTION_ANYURI               1<<4
+#define OPTION_MERGEBASE            1<<5
 
 #ifndef RAND_MAX
 #define RAND_MAX 32767
@@ -2823,8 +2824,11 @@ static void *config_perdir_merge(apr_poo
     a->state_set = overrides->state_set || base->state_set;
     a->options = (overrides->options_set == 0) ? base->options : overrides->options;
     a->options_set = overrides->options_set || base->options_set;
-    a->baseurl = (overrides->baseurl_set == 0) ? base->baseurl : overrides->baseurl;
-    a->baseurl_set = overrides->baseurl_set || base->baseurl_set;
+
+    if (a->options & OPTION_MERGEBASE) { 
+        a->baseurl = (overrides->baseurl_set == 0) ? base->baseurl : overrides->baseurl;
+        a->baseurl_set = overrides->baseurl_set || base->baseurl_set;
+    }
 
     a->directory  = overrides->directory;
 
@@ -2899,6 +2903,9 @@ static const char *cmd_rewriteoptions(cm
         else if (!strcasecmp(w, "allowanyuri")) {
             options |= OPTION_ANYURI;
         }
+        else if (!strcasecmp(w, "mergebase")) {
+            options |= OPTION_MERGEBASE;
+        }
         else {
             return apr_pstrcat(cmd->pool, "RewriteOptions: unknown option '",
                                w, "'", NULL);



Mime
View raw message