Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix autoescaping for Twig 2.x #102

Open
andriokha opened this issue Feb 20, 2023 · 0 comments · May be fixed by #103
Open

Fix autoescaping for Twig 2.x #102

andriokha opened this issue Feb 20, 2023 · 0 comments · May be fixed by #103

Comments

@andriokha
Copy link

andriokha commented Feb 20, 2023

Thanks for a very useful project!

Currently there's a boolean configuration option called autoescape that gets passed directly to \Twig\Environment::__construct() in

$twig = new \Twig_Environment($loaders, [
'debug' => $this->config['debug'],
'autoescape' => $this->config['autoescape'],

In Twig 1:

  • true is the same as html and uses that escaping strategy
  • false disables auto-escaping

In Twig 2 true was removed as an option (so to get the old true behaviour you should pass html).

It occurred to me that we could expose the full range of options, but I'm not sure if there's really any demand for that.

andriokha added a commit to FabbDev/twig-renderer that referenced this issue Feb 20, 2023
@andriokha andriokha linked a pull request Feb 20, 2023 that will close this issue
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant