-
Bug
-
Resolution: Fixed
-
Neutral
-
4.4.4
-
-
Yes
-
Empty show more show less
-
Yes
Steps to reproduce:
1. Use the url built-in to render a variable in a freemarker template ("title?url", for example)
Expected result:
The template should output a URL-encoded version of the title variable
Actual result:
To do URL encoding, the framework that encloses FreeMarker must specify the output encoding or the URL encoding charset, so ask the programmers to fix it. Or, as a last chance, you can set the url_encoding_charset setting in the template, e.g. <#setting url_escaping_charset='ISO-8859-1'>, or give the charset explicitly to the buit-in, e.g. foo?url('ISO-8859-1'). The problematic instruction: ---------- ==> ${title?url} [on line 62, column 9 in templating-kit/templates/global/mainAreaIntro.ftl] in include def.mainArea.intro.template [on line 2, column 5 in templating-kit/templates/global/mainArea.ftl] in include "../global/mainArea.ftl" [on line 4, column 5 in templating-kit/templates/content/mainArea.ftl] in include def.mainArea.template [on line 48, column 21 in templating-kit/templates/main.ftl] ----------
One can work around this by setting the encoding in the template, but one shouldn't have to.
Patch with fix and test case included.
Acceptance criteria
- is duplicated by
-
MAGNOLIA-1184 FreemarkerUtil should set the urlEscapingCharset
- Closed
-
MAGNOLIA-3286 Add new setting URLEscapingCharset to the freemarker config
- Closed