]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport recent rewrite trunk features
authorEric Covener <covener@apache.org>
Fri, 31 Mar 2023 13:26:23 +0000 (13:26 +0000)
committerEric Covener <covener@apache.org>
Fri, 31 Mar 2023 13:26:23 +0000 (13:26 +0000)
https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/348.diff

Submitted by: covener
Reviewed by: covener, ylavic, rpluem

Github: closes #348

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1908859 13f79535-47bb-0310-9956-ffa450edef68

changes-entries/rewrite-qsd-regression.diff [new file with mode: 0644]
modules/mappers/mod_rewrite.c

diff --git a/changes-entries/rewrite-qsd-regression.diff b/changes-entries/rewrite-qsd-regression.diff
new file mode 100644 (file)
index 0000000..ffba2ba
--- /dev/null
@@ -0,0 +1,3 @@
+  *) mod_rewrite: Fix a 2.4.56 regression for substitutions ending
+     in a question mark. PR66547. [Eric Covener]
+
index 709ffc5289c0e90997311a9377ddc6e0d7794e3a..f93f23f04f9e3cf5ba1e83770be7b0ba6d69d25c 100644 (file)
@@ -3866,6 +3866,7 @@ 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 */
     }
     else if (newrule->flags & RULEFLAG_QSDISCARD) {
         if (NULL == ap_strchr(newrule->output, '?')) {