Bug #27678

Deactivate EscapeInterceptor for certain ViewHelpers

Added by Bastian Waidelich over 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Should have
Category:
ViewHelpers
Target version:
-
Start date:
2011-06-24
Due date:
% Done:

100%

Estimated time:
Has patch:
No

Description

For some of the provided ViewHelpers one can exchangeably use either the value attribute or childnodes as input.

So all of the below variants should behave the same:

<f:format.plaintext>{foo}</f:format.plaintext>
{foo -> f:format.plaintext()}
<f:format.plaintext value="{foo}" />
{f:format.plaintext(value: foo)}

But in fact the first two examples will get an escaped {foo} because by default the EscapeInterceptor is activated.

A solution would be to deactivate the interceptor for those ViewHelper by inserting the line

protected $escapingInterceptorEnabled = FALSE;

NOTE: This disables htmlspecialchars() from beeing applied to childnodes so this must not be done for ViewHelpers that directly output the childnodes again!

Also available in: Atom PDF