Bug #38871
Generating links within script tags gives invalid documents
0%
Description
When generating a link in a fluid template, which is enclosed by script-Tags to a given format, the ampersands are not escaped.
So
<script type="text/javascript">
var link = '{f:uri.action(action: 'someAction')}';
</script>
generates a link like this:
index.php?id=123&tx_ext_pi1[controller]=SomeController&tx_ext_pi1[action]=someAction&cHash=foobar
This is invalid XHTML (even inside a script, according to the W3C-Validator), as the ampersands are literals. The same thing works fine outside of script tags.
Updated by Adrian Föder over 9 years ago
- Status changed from New to Closed
Jost,
I just tried in in Flow context and it doesn't encode the ampersands since it's not necessary in plain HTML (non-xhtml). If you need to encode the ampersand anyways, add the format.htmlentities
ViewHelper just like this:
{f:uri.action(action: 'someAction') -> f:format.htmlentities()}
Don't hesitate to reopen if you don't agree or if extbase is still affected with it.