summaryrefslogtreecommitdiffstats
path: root/modules/mappers
diff options
context:
space:
mode:
authorEric Covener <covener@apache.org>2023-06-28 16:31:25 +0200
committerEric Covener <covener@apache.org>2023-06-28 16:31:25 +0200
commit5b6275ffdc8f439fe1802c79a6d0d582e9cf6796 (patch)
treedddefe024d9bbbed94f109b14210f6eab79381d7 /modules/mappers
parentFollow up to r1910656: Fix dumplicate APLOGNO. (diff)
downloadapache2-5b6275ffdc8f439fe1802c79a6d0d582e9cf6796.tar.xz
apache2-5b6275ffdc8f439fe1802c79a6d0d582e9cf6796.zip
incorporate feedback from rpluem
update comments, reverse check, force QSL [skip ci] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910666 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/mappers')
-rw-r--r--modules/mappers/mod_rewrite.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c
index 47f575b258..95697c911a 100644
--- a/modules/mappers/mod_rewrite.c
+++ b/modules/mappers/mod_rewrite.c
@@ -3910,13 +3910,16 @@ 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 */
- if (!(newrule->flags & RULEFLAG_QSAPPEND)) {
- /* trailing ? has done its job. with QSA, splitoutqueryargs
- * will handle it
- */
- *(a2_end-1) = '\0';
- newrule->flags |= RULEFLAG_QSNONE;
+ if (newrule->flags & RULEFLAG_QSAPPEND) {
+ /* with QSA, splitoutqueryargs will safely handle it if RULEFLAG_QSLAST is set */
+ newrule->flags |= RULEFLAG_QSLAST;
}
+ else {
+ /* avoid getting a a query string via inadvertent capture */
+ newrule->flags |= RULEFLAG_QSNONE;
+ /* trailing ? has done its job, but splitoutqueryargs will not chop it off */
+ *(a2_end-1) = '\0';
+ }
}
else if (newrule->flags & RULEFLAG_QSDISCARD) {
if (NULL == ap_strchr(newrule->output, '?')) {