trustlydaniel commented on code in PR #2106:
URL: https://github.com/apache/cxf/pull/2106#discussion_r1799768075


##########
rt/features/logging/src/main/java/org/apache/cxf/ext/logging/MaskSensitiveHelper.java:
##########
@@ -32,7 +32,7 @@ public class MaskSensitiveHelper {
             + 
"\\u00F8-\\u02FF\\u0300-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F"
             + "\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]+";
     private static final String MATCH_PATTERN_XML_TEMPLATE = "(<(" + 
PATTERN_XML_NAMESPACE_PREFIX
-            + ":)?-ELEMENT_NAME-.*?>)(.*?)(</(" + PATTERN_XML_NAMESPACE_PREFIX 
+ ":)?-ELEMENT_NAME->)";
+            + ":)?-ELEMENT_NAME-\\b[^>]*>)(.*?)(</(" + 
PATTERN_XML_NAMESPACE_PREFIX + ":)?-ELEMENT_NAME->)";

Review Comment:
   ```
   <passwords><password>my secret password</password></passwords>
   ```
   
   For example, without `\b`, the pattern `<password[^>]*>` could still 
incorrectly match `<passwords>`. The `\b` ensures that only `<password>` is 
matched and not `<passwords>`.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cxf.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to