Bug #38871
Generating links within script tags gives invalid documents
Status: | Closed | Start date: | 2012-07-11 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | ViewHelpers | |||
Target version: | - | |||
Has patch: | No | Affected Flow version: | (any) |
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.
History
#1 Updated by Adrian Föder over 2 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.