Project

General

Profile

Actions

Bug #91742

closed

Fluid view helper asset.script escape children

Added by Roman Büchler over 4 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2020-07-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

A variable (e.g. data.bodytext) holds json data. When using it in a fluid asset script view helper the resulting json code is escaped:

<f:asset.script identifier="pp-schema-{data.uid}" type="application/ld+json">
{data.bodytext}
</f:asset.script>

Escaped result:

<script type="application/ld+json">
{
  &quot;@context&quot;:&quot;http://schema.org&quot;,
  &quot;@type&quot;:&quot;Hotel&quot;,

The view helper script has escapeOutput disabled.

When creating a descendent view helper and setting escapeChildren to false the resulting code won't be escaped any more hence the output is as expected. According to the description it shouldn't be needed to disable escapeChildren:

"If escaping of children is disabled, no nodes that are passed with inline syntax or values used as tag content will be escaped. Note that $escapeOutput takes priority: if it is disabled, escaping of child nodes is also disabled unless explicitly enabled."


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #92284: <f:asset.script> ViewHelper double escape the src attributeClosedFrank Nägler2020-09-10

Actions
Actions

Also available in: Atom PDF