From: Eric Covener Date: Fri, 2 Aug 2019 01:31:28 +0000 (+0000) Subject: set PCRE_DOTALL by default X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=905b4af030203d0e0240356c75671c19e2f692d6;p=apache set PCRE_DOTALL by default Submitted by ylavic git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1864192 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index bab60ab840..c9a334e1d0 100644 --- 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 diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml index ac428dfe4b..49f06b3de2 100644 --- a/docs/manual/mod/core.xml +++ b/docs/manual/mod/core.xml @@ -4189,7 +4189,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. @@ -4208,24 +4208,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 8254cc4d63..b7c1e041ee 100644 --- a/server/util_pcre.c +++ b/server/util_pcre.c @@ -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) {