Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not remove escaping on TwigFilter by default #202

Closed
wants to merge 2 commits into from

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Jun 13, 2018

fixes #200

new TwigFilter('filter_name', [$this, 'doSomething'], ['is_safe' => ['html']]),
// If your filter generates SAFE HTML, you should add a third
// parameter: ['is_safe' => ['html']]
// Reference: https://twig.symfony.com/doc/2.x/advanced.html#automatic-escaping
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or add an --safe-html option on the command? Such comments will be committed usually, thus be noise to many lazy fools (all of us ;) )

Copy link
Member Author

@lyrixx lyrixx Jun 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost all code generated by this bundle should be updated by the end user. So I prefer to not add a new option
For example the callback on the next line should be updated.

@weaverryan weaverryan closed this in 9170355 Aug 6, 2018
@lyrixx lyrixx deleted the twig-security branch October 19, 2018 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why twig extension are "HTML safe" by default ?
3 participants