1
0
mirror of https://github.com/apache/httpd.git synced 2025-07-13 06:21:50 +03:00

Follow up to r1873941: define AP_REG_NO_DEFAULT for raw ap_regcomp() usage.

This avoids having to define AP_REG_NO_* for each APR_REG_* specific option,
thus replacing AP_REG_NO_DOTALL introduced lately.

For ap_rxplus_compile() and mod_substitute where default AP_REG_DOTALL is not
suitable, let's use:
    AP_REG_NO_DEFAULT | ap_regcomp_get_default_cflags() & AP_REG_DOLLAR_ENDONLY
to keep the default AP_REG_DOLLAR_ENDONLY unless RegexDefaultOptions unsets it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874090 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yann Ylavic
2020-02-16 23:08:32 +00:00
parent e957c6ddc9
commit c8f486d716
5 changed files with 11 additions and 12 deletions

View File

@ -94,6 +94,7 @@ AP_DECLARE(ap_rxplus_t*) ap_rxplus_compile(apr_pool_t *pool,
}
/* anything after the current delimiter is flags */
ret->flags = ap_regcomp_get_default_cflags() & AP_REG_DOLLAR_ENDONLY;
while (*++endp) {
switch (*endp) {
case 'i': ret->flags |= AP_REG_ICASE; break;
@ -101,13 +102,12 @@ AP_DECLARE(ap_rxplus_t*) ap_rxplus_compile(apr_pool_t *pool,
case 'n': ret->flags |= AP_REG_NOMEM; break;
case 'g': ret->flags |= AP_REG_MULTI; break;
case 's': ret->flags |= AP_REG_DOTALL; break;
case 'S': ret->flags |= AP_REG_NO_DOTALL; break;
case '^': ret->flags |= AP_REG_NOTBOL; break;
case '$': ret->flags |= AP_REG_NOTEOL; break;
default: break; /* we should probably be stricter here */
}
}
if (ap_regcomp(&ret->rx, rxstr, ret->flags) == 0) {
if (ap_regcomp(&ret->rx, rxstr, AP_REG_NO_DEFAULT | ret->flags) == 0) {
apr_pool_cleanup_register(pool, &ret->rx, rxplus_cleanup,
apr_pool_cleanup_null);
}