Skip to content

Commit

Permalink
PR66672: rewrite QSA+trailing ? regression
Browse files Browse the repository at this point in the history
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
  • Loading branch information
covener committed Jun 27, 2023
1 parent 6625427 commit 2d8a447
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changes-entries/pr66672.txt
Original file line number Diff line number Diff line change
@@ -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>
7 changes: 5 additions & 2 deletions modules/mappers/mod_rewrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, '?')) {
Expand Down

0 comments on commit 2d8a447

Please sign in to comment.