From a1472b3c52294b80eab45abecb1c11209e9db4a6 Mon Sep 17 00:00:00 2001 From: Deepak Dixit Date: Mon, 28 Oct 2024 18:24:32 +0530 Subject: [PATCH] Improve Parameter Encoding in MacroMenuRenderer (OFBIZ-13162) --- .../ofbiz/widget/renderer/macro/MacroMenuRenderer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java index 0a5b96310d0..c989c32819a 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java @@ -268,7 +268,12 @@ public void renderLink(Appendable writer, Map context, MenuLink targetParameters.append(parameter.getKey()); targetParameters.append("'"); targetParameters.append(",'value':'"); - targetParameters.append(parameter.getValue()); + UtilCodec.SimpleEncoder simpleEncoder = (UtilCodec.SimpleEncoder) context.get("simpleEncoder"); + if (simpleEncoder != null) { + targetParameters.append(simpleEncoder.encode(parameter.getValue())); + } else { + targetParameters.append(parameter.getValue()); + } targetParameters.append("'}"); } targetParameters.append("]");