]> granicus.if.org Git - apache/commitdiff
set PCRE_DOTALL by default
authorEric Covener <covener@apache.org>
Fri, 2 Aug 2019 01:31:28 +0000 (01:31 +0000)
committerEric Covener <covener@apache.org>
Fri, 2 Aug 2019 01:31:28 +0000 (01:31 +0000)
Submitted by ylavic

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

CHANGES
docs/manual/mod/core.xml
server/util_pcre.c

diff --git a/CHANGES b/CHANGES
index bab60ab8406ad4e86c61a2819255bccea3c2b1a5..c9a334e1d00840c1de02d21abf606d8a63375d3b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.1
 
+  *) core, mod_rewrite: Set PCRE_DOTALL by default. Revert via 
+     RegexDefaultOptions -DOTALL [Yann Ylavic]
+
   *) core: Remove request details from built-in error documents [Eric Covener]
 
   *) mod_http2: core setting "LimitRequestFieldSize" is not additionally checked on
index ac428dfe4ba97c26cfe74897259428c2287dd79a..49f06b3de202b3149363ebc0986ccbecc4c8082e 100644 (file)
@@ -4189,7 +4189,7 @@ Protocols h2 http/1.1
     <name>RegexDefaultOptions</name>
     <description>Allow to configure global/default options for regexes</description>
     <syntax>RegexDefaultOptions [none] [+|-]<var>option</var> [[+|-]<var>option</var>] ...</syntax>
-    <default>RegexDefaultOptions DOLLAR_ENDONLY</default>
+    <default>RegexDefaultOptions DOTALL DOLLAR_ENDONLY</default>
     <contextlist><context>server config</context></contextlist>
     <compatibility>Only available from Apache 2.4.30 and later.</compatibility>
     
@@ -4208,24 +4208,26 @@ Protocols h2 http/1.1
             <dt><code>ICASE</code></dt>
             <dd>Use a case-insensitive match.</dd>
 
+            <dt><code>EXTENDED</code></dt>
+            <dd>Perl's /x flag, ignore (unescaped-)spaces and comments in the pattern.</dd>
+
             <dt><code>DOTALL</code></dt>
-            <dd>Perl's /s flag.</dd>
+            <dd>Perl's /s flag, '.' matches newline characters.</dd>
 
             <dt><code>DOLLAR_ENDONLY</code></dt>
             <dd>'$' matches at end of subject string only.</dd>
-            <dd>.</dd>
         </dl>
         <highlight language="config">
-# 
-RegexDefaultOptions +ICASE +DOLLAR_ENDONLY
+# Add the ICASE option for all regexes by default
+RegexDefaultOptions +ICASE
 ...
-# Remove the ICASE option, but keep all the other already set options
-RegexDefaultOptions -ICASE
+# Remove the default DOLLAR_ENDONLY option, but keep any other one
+RegexDefaultOptions -DOLLAR_ENDONLY
 ...
-# Set the default option to DOTALL, resetting any other option
+# Set the DOTALL option only, resetting any other one
 RegexDefaultOptions DOTALL
 ...
-# Reset all defined option
+# Reset all defined options
 RegexDefaultOptions none
 ...
         </highlight>
index 8254cc4d63d356a67efc3ccdcaae84a829d2dd95..b7c1e041ee8553baddb48e4beacbaacab123a28f 100644 (file)
@@ -157,7 +157,8 @@ AP_DECLARE(void) ap_regfree(ap_regex_t *preg)
  *            Compile a regular expression       *
  *************************************************/
 
-static int default_cflags = AP_REG_DOLLAR_ENDONLY;
+static int default_cflags = AP_REG_DOTALL |
+                            AP_REG_DOLLAR_ENDONLY;
 
 AP_DECLARE(int) ap_regcomp_get_default_cflags(void)
 {