(tomcat) branch main updated: Ensure capture groups from RewriteCond reflect the current request

[email protected]
Newsgroups gmane.comp.jakarta.tomcat.devel
Message-ID <[email protected]>
This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 932e9507ed Ensure capture groups from RewriteCond reflect the current request
932e9507ed is described below

commit 932e9507edfd7368fc7bbbc6113e59a18d09f296
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Aug 13 11:35:37 2026 +0100

    Ensure capture groups from RewriteCond reflect the current request
---
 java/org/apache/catalina/valves/rewrite/RewriteCond.java | 1 +
 webapps/docs/changelog.xml                               | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/java/org/apache/catalina/valves/rewrite/RewriteCond.java b/java/org/apache/catalina/valves/rewrite/RewriteCond.java
index 6eaa2719a8..5203c7ff8a 100644
--- a/java/org/apache/catalina/valves/rewrite/RewriteCond.java
+++ b/java/org/apache/catalina/valves/rewrite/RewriteCond.java
@@ -74,6 +74,7 @@ public class RewriteCond {
                 matcher.set(m);
                 return true;
             } else {
+                matcher.set(null);
                 return false;
             }
         }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 111fb24911..c777765e3f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -249,6 +249,10 @@
         this fix, paths containing literal <code>'?'</code> characters were
         truncated. (markt)
       </fix>
+      <fix>
+        Ensure that capture groups from a <code>RewriteCond</code> always
+        reflect the result of the current request. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.