[Bugfix]: mark editables anywhere in Twig as "safe"#18620
[Bugfix]: mark editables anywhere in Twig as "safe"#18620fashxp merged 1 commit intopimcore:11.5from
Conversation
Review Checklist
|
|
Is there any chance of this being considered for Pimcore 11.5.9? |
0304593 to
c487ee9
Compare
|
|
Sonar issue has nothing to do with this PR. |
|
Maybe we can get this in Pimcore 11.5.10? |
|
Any chance to get this merged into 11.5.12? |
|
Do I get this right, in Wondering, if we might introduce some hidden security topics with this? |
|
Well, “'just' the functions prefixed with Since The Twig function Marking |
|
thx very much... |




Changes in this pull request
Editables are already marked as
safein thepimocre_*Twig function definition.But that only seems to work inside the very template the function is used.
As soon as you start passing it around, like:
You suddenly have to apply the
rawfilter, otherwise you'll get double-escaped output:This makes it difficult, because the
headlinemay not always be an editable, but something else that you want to escape.So you would have to do stuff like this:
All of this would not be necessary if Twig would know that instances of
Editablehandle escaping themselves (like it already is for the editable functions).Then you can just use it with auto-escaping and everything is fine:
This is what this bug fix achieves.