]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
back to original patch in PR66672
authorEric Covener <covener@apache.org>
Wed, 28 Jun 2023 12:37:50 +0000 (12:37 +0000)
committerEric Covener <covener@apache.org>
Wed, 28 Jun 2023 12:37:50 +0000 (12:37 +0000)
Since QSNONE will skip splitoutqueryargs, it's where we should fixup the trailing ?

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910662 13f79535-47bb-0310-9956-ffa450edef68

modules/mappers/mod_rewrite.c

index 7fb4e92c0de1a9bd182009e95b3e4eed9714ee49..47f575b2586bcd35d76350319e6ce16c63760882 100644 (file)
@@ -3909,10 +3909,12 @@ static const char *cmd_rewriterule(cmd_parms *cmd, void *in_dconf,
     }
 
     if (*(a2_end-1) == '?') {
-        *(a2_end-1) = '\0'; /* trailing ? has done its job */
         /* a literal ? at the end of the unsubstituted rewrite rule */
-        if (!(newrule->flags & RULEFLAG_QSAPPEND))
-        {
+        if (!(newrule->flags & RULEFLAG_QSAPPEND)) {
+            /* trailing ? has done its job.  with QSA, splitoutqueryargs 
+             * will handle it 
+             */ 
+            *(a2_end-1) = '\0'; 
             newrule->flags |= RULEFLAG_QSNONE;
         }
     }