diff --git a/CHANGES b/CHANGES
index bf00b5114b0..ad4fd27625b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
-*- coding: utf-8 -*-
Changes with Apache 2.4.40
+ *) 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
diff --git a/STATUS b/STATUS
index 3c3cf39f48e..f9bfc678fd4 100644
--- a/STATUS
+++ b/STATUS
@@ -127,11 +127,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) core, rewrite: Set PCRE_DOTALL by default
- trunk: http://svn.apache.org/1864192
- 2.4.x: svn merge -c 1864192 ^/httpd/httpd/trunk .
- +1: covener, rpluem, icing
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml
index d9f0895af4d..d4d6030dc59 100644
--- a/docs/manual/mod/core.xml
+++ b/docs/manual/mod/core.xml
@@ -4061,7 +4061,7 @@ Protocols h2 http/1.1
RegexDefaultOptions
Allow to configure global/default options for regexes
RegexDefaultOptions [none] [+|-]option [[+|-]option] ...
- RegexDefaultOptions DOLLAR_ENDONLY
+ RegexDefaultOptions DOTALL DOLLAR_ENDONLY
server config
Only available from Apache 2.4.30 and later.
@@ -4080,24 +4080,26 @@ Protocols h2 http/1.1
ICASE
Use a case-insensitive match.
+ EXTENDED
+ Perl's /x flag, ignore (unescaped-)spaces and comments in the pattern.
+
DOTALL
- Perl's /s flag.
+ Perl's /s flag, '.' matches newline characters.
DOLLAR_ENDONLY
'$' matches at end of subject string only.
- .
-#
-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
...
diff --git a/server/util_pcre.c b/server/util_pcre.c
index f2cb1bb01e8..35831f500f9 100644
--- a/server/util_pcre.c
+++ b/server/util_pcre.c
@@ -120,7 +120,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)
{