yesamer commented on code in PR #6320:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6320#discussion_r2055435349


##########
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/util/XQueryImplUtil.java:
##########
@@ -26,17 +26,25 @@
 import net.sf.saxon.s9api.XQueryExecutable;
 import net.sf.saxon.s9api.SaxonApiException;
 
+import java.util.regex.Pattern;
+
 public class XQueryImplUtil {
 
+    static Pattern XML_CHARACTER_REFERENCES_PATTERN = 
Pattern.compile("['\"&<>]");
+
+    private XQueryImplUtil() {
+        // Util class with static methods only.
+    }
+
     public static Boolean executeMatchesFunction(String input, String pattern, 
String flags) {
         flags = flags == null ? "" : flags;
-        String xQueryExpression = String.format("matches('%s', '%s', '%s')", 
input, pattern, flags);
+        String xQueryExpression = String.format("matches('%s', '%s', '%s')", 
sanitizeXmlCharacterReferences(input), sanitizeXmlCharacterReferences(pattern), 
flags);

Review Comment:
   @bncriju Changed to `escapeXmlCharactersReferencesForXPath` thank you.



##########
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/util/XQueryImplUtil.java:
##########
@@ -26,17 +26,25 @@
 import net.sf.saxon.s9api.XQueryExecutable;
 import net.sf.saxon.s9api.SaxonApiException;
 
+import java.util.regex.Pattern;
+
 public class XQueryImplUtil {
 
+    static Pattern XML_CHARACTER_REFERENCES_PATTERN = 
Pattern.compile("['\"&<>]");

Review Comment:
   Done



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to