This is an automated email from the ASF dual-hosted git repository.

jacopoc pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 27373f2384 Fixed: Fix regex pattern matching to escape special 
characters in fragment name
27373f2384 is described below

commit 27373f23848f216233a5187d9ae6bc58e9c16d1d
Author: Jacopo Cappellato <[email protected]>
AuthorDate: Thu May 28 14:58:15 2026 +0200

    Fixed: Fix regex pattern matching to escape special characters in fragment 
name
---
 .../common/src/main/java/org/apache/ofbiz/common/CommonEvents.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java 
b/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java
index 7c52297caa..c653128b57 100644
--- a/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java
+++ b/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java
@@ -35,6 +35,7 @@ import java.io.Writer;
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.regex.Pattern;
 
 import javax.imageio.ImageIO;
 import jakarta.servlet.http.HttpServletRequest;
@@ -423,7 +424,7 @@ public class CommonEvents {
                         try (LineNumberReader lnr = new LineNumberReader(new 
FileReader(platformSpecificPath))) {
                             String line;
                             while ((line = lnr.readLine()) != null) {
-                                if (line.matches(".*name=\"" + fragment + 
"\".*")) {
+                                if (line.matches(".*name=\"" + 
Pattern.quote(fragment) + "\".*")) {
                                     lineNumber = lnr.getLineNumber();
                                     break;
                                 }

Reply via email to