You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Mridul Pathak (Jira)" <ji...@apache.org> on 2026/10/06 14:29:00 UTC
[jira] [Closed] (OFBIZ-13649) Escape backslash and braces in the FreeMarker macro strings built by the macro menu, tree and form renderers
[ https://issues.apache.org/jira/browse/OFBIZ-13649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mridul Pathak closed OFBIZ-13649.
---------------------------------
Fix Version/s: Upcoming Branch
24.09.08
Resolution: Fixed
> Escape backslash and braces in the FreeMarker macro strings built by the macro menu, tree and form renderers
> ------------------------------------------------------------------------------------------------------------
>
> Key: OFBIZ-13649
> URL: https://issues.apache.org/jira/browse/OFBIZ-13649
> Project: OFBiz
> Issue Type: Bug
> Components: framework/widget
> Affects Versions: Upcoming Branch, 24.09.07
> Reporter: Mridul Pathak
> Assignee: Mridul Pathak
> Priority: Major
> Fix For: Upcoming Branch, 24.09.08
>
>
> MacroMenuRenderer.executeMacro(Appendable, String, Map), MacroTreeRenderer (imgStr) and MacroFormRenderer (encodeDoubleQuotes) build parts of a macro call as template text and only escape the double quote of the value. Backslashes and the FreeMarker interpolation characters are left as they are, so a value containing them is interpreted by FreeMarker instead of being rendered literally (or fails to parse). MacroScreenRenderer.executeMacro already escapes backslash, double quote and the opening brace.
> h3. Proposed change
> Add one shared helper that escapes a value for a double-quoted FreeMarker string literal (backslash, double quote, opening brace), use it in MacroScreenRenderer and in the three places above in place of the quote-only escaping, and add unit tests that render values containing backslashes, quotes, ${...}, #{...} and braces and check that they come back literally. Existing widget output must stay the same for normal text.
> h3. Scope and risk
> Only the existing quote-only escapes are replaced. The values that MacroTreeRenderer and MacroFormRenderer append without any escaping are not changed here; they are part of the broader work on keeping user data out of macro template text (OFBIZ-11456). A value that today relies on being evaluated as a FreeMarker expression in one of these strings would now be rendered literally, so the widget tests and a manual check of menus, trees and forms are needed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)