PR66672: rewrite QSA+trailing ? regression

mod_rewrite: Fix a recent regression where a rule with both a trailing
'?' and the [QSA] flag did not have the query appended.  PR66672

Submitted By: Frank Meier <frank.meier ergon.ch>



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910633 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eric Covener
2023-06-27 14:33:50 +00:00
parent 66254273e2
commit 2d8a447551
2 changed files with 8 additions and 2 deletions

View File

@ -0,0 +1,3 @@
*) mod_rewrite: Fix a recent regression where a rule with both a trailing
'?' and the [QSA] flag did not have the query appended. PR66672
Frank Meier <frank.meier ergon.ch>

View File

@ -3909,9 +3909,12 @@ static const char *cmd_rewriterule(cmd_parms *cmd, void *in_dconf,
}
if (*(a2_end-1) == '?') {
/* a literal ? at the end of the unsubstituted rewrite rule */
newrule->flags |= RULEFLAG_QSNONE;
*(a2_end-1) = '\0'; /* trailing ? has done its job */
/* a literal ? at the end of the unsubstituted rewrite rule */
if (!(newrule->flags & RULEFLAG_QSAPPEND))
{
newrule->flags |= RULEFLAG_QSNONE;
}
}
else if (newrule->flags & RULEFLAG_QSDISCARD) {
if (NULL == ap_strchr(newrule->output, '?')) {