]> granicus.if.org Git - apache/commitdiff
Very difficult to read, and therefore was wrong.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 30 Jun 2015 01:27:42 +0000 (01:27 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 30 Jun 2015 01:27:42 +0000 (01:27 +0000)
Assert that the SubstituteInheritBefore option was explicitly toggled,
and do not default in 2.x to this legacy behavior.

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

modules/filters/mod_substitute.c

index 648f7de28221148f78354c2cb20b8ad270eaaba1..cdc8c04532e3460de672ffa2dd66a987bfea804c 100644 (file)
@@ -86,9 +86,16 @@ static void *merge_substitute_dcfg(apr_pool_t *p, void *basev, void *overv)
     subst_dir_conf *base = (subst_dir_conf *) basev;
     subst_dir_conf *over = (subst_dir_conf *) overv;
 
-    a->inherit_before = (over->inherit_before > 0 || (over->inherit_before < 0 &&
-                                                      base->inherit_before > 0));
-    if (a->inherit_before) {
+    a->inherit_before = (over->inherit_before != -1)
+                            ? over->inherit_before
+                            : base->inherit_before;
+    /* SubstituteInheritBefore was the default behavior until 2.5.x,
+     * and may be re-enabled as desired; this original default behavior
+     * was to apply inherited subst patterns before locally scoped patterns.
+     * In later 2.2 and 2.4 versions, SubstituteInheritBefore may be toggled
+     * 'off' to follow the corrected/expected behavior, without violating POLS.
+     */
+    if (a->inherit_before == 1) {
         a->patterns = apr_array_append(p, base->patterns,
                                           over->patterns);
     }