(tomcat) branch 10.1.x 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 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 83d195f46c Ensure capture groups from RewriteCond reflect the current request
83d195f46c is described below

commit 83d195f46c53d3fb8763c8e0146a09814c46a587
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 b86a9723d3..0787b04f22 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 bad9fc0709..b3ef171e3a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -218,6 +218,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.