Bug #38871
Generating links within script tags gives invalid documents
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
ViewHelpers
Target version:
-
Start date:
2012-07-11
Due date:
% Done:
0%
Estimated time:
Has patch:
No
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.