Skip to content

Commit

Permalink
Merge of r1864192 from trunk:
Browse files Browse the repository at this point in the history
  *) core, rewrite: Set PCRE_DOTALL by default



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1864213 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
icing committed Aug 2, 2019
1 parent f3f595e commit 3b3117e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
3 changes: 3 additions & 0 deletions 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
Expand Down
5 changes: 0 additions & 5 deletions STATUS
Expand Up @@ -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 ]
Expand Down
20 changes: 11 additions & 9 deletions docs/manual/mod/core.xml
Expand Up @@ -4061,7 +4061,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>

Expand All @@ -4080,24 +4080,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>
Expand Down
3 changes: 2 additions & 1 deletion server/util_pcre.c
Expand Up @@ -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)
{
Expand Down

0 comments on commit 3b3117e

Please sign in to comment.