You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today when a value object is inherently safe to output it must extend {{Twig\Markup}} and therefore introduce a hard dependency to Twig. It would be appreciated if one could reverse that relationship and mark a type as safe. Something like:
twig_escape_filter() would use that list to look up if the passed object is considered safe for the current escaping and output the result of __toString() as is.
The text was updated successfully, but these errors were encountered:
lstrojny
changed the title
Mark type as "safe"
Mark types as "safe"
Aug 23, 2017
…ing safe (fabpot)
This PR was squashed before being merged into the 2.x branch (closes#3025).
Discussion
----------
Add the possibility to register classes/interface as being safe
closes#2548
To avoid a too big performance impact on the escaper, we aggressively cache the safe classes, which means that changing the. configuration at runtime is not possible (and having different ones on 2 Twig instances is not possible either, this is really *globally* configured).
Commits
-------
fe6503f -
b18733b added the possibility to register classes/interfaces as being safe for the escaper
Today when a value object is inherently safe to output it must extend {{Twig\Markup}} and therefore introduce a hard dependency to Twig. It would be appreciated if one could reverse that relationship and mark a type as safe. Something like:
twig_escape_filter()
would use that list to look up if the passed object is considered safe for the current escaping and output the result of__toString()
as is.The text was updated successfully, but these errors were encountered: