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

mridulpathak 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 70788dcee7 Fixed: Encode the source URL of screen image widgets
70788dcee7 is described below

commit 70788dcee7fc5cc1800c2200bfd286655a56aae8
Author: Mridul Pathak <[email protected]>
AuthorDate: Sun Oct 18 18:09:02 2026 +0530

    Fixed: Encode the source URL of screen image widgets
    
    The src attribute of the screen image widget was rendered without encoding, 
unlike its alt attribute. The final URL is now encoded with the context encoder 
after it has been built, so that intra-app and content URLs are still resolved 
from the unencoded value.
---
 .../org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java  | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
index 8061fe2b76..7b0cc67180 100644
--- 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
+++ 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
@@ -34,6 +34,7 @@ import javax.xml.parsers.ParserConfigurationException;
 
 import org.apache.ofbiz.base.util.Debug;
 import org.apache.ofbiz.base.util.GeneralException;
+import org.apache.ofbiz.base.util.UtilCodec;
 import org.apache.ofbiz.base.util.UtilFormatOut;
 import org.apache.ofbiz.base.util.UtilGenerics;
 import org.apache.ofbiz.base.util.UtilHttp;
@@ -320,6 +321,10 @@ public class MacroScreenRenderer implements 
ScreenStringRenderer {
         } else {
             urlString = src;
         }
+        UtilCodec.SimpleEncoder simpleEncoder = (UtilCodec.SimpleEncoder) 
context.get("simpleEncoder");
+        if (simpleEncoder != null) {
+            urlString = simpleEncoder.encode(urlString);
+        }
         Map<String, Object> parameters = new HashMap<>();
         parameters.put("src", src);
         parameters.put("id", image.getId(context));

Reply via email to