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

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


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

commit fad731874cc462db098287061d100ebfffb610d9
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
    
    (cherry picked from commit 27373f23848f216233a5187d9ae6bc58e9c16d1d)
---
 .../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 1be79c5f85..66af92d7cf 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 javax.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