Skip to content

[TwigBundle] Moved the setting of the default escaping strategy from the Twig engine to the Twig environment #13141

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

Merged
merged 1 commit into from
Dec 29, 2014

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Dec 28, 2014

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #11773
License MIT
Doc PR n/a

The default escaping strategy was set on the Twig Engine and not the Twig Environment. That's a problem under some circumstances (like what #11773 describes), but it's also much better to set everything on the Twig Environment directly.

@fabpot fabpot force-pushed the twig-escaping-strategy branch from 4177ee9 to e56f5e6 Compare December 29, 2014 08:04
@fabpot fabpot force-pushed the twig-escaping-strategy branch from e56f5e6 to 91b24e8 Compare December 29, 2014 08:39
@fabpot fabpot merged commit 91b24e8 into symfony:2.3 Dec 29, 2014
fabpot added a commit that referenced this pull request Dec 29, 2014
…ategy from the Twig engine to the Twig environment (fabpot)

This PR was merged into the 2.3 branch.

Discussion
----------

[TwigBundle] Moved the setting of the default escaping strategy from the Twig engine to the Twig environment

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11773
| License       | MIT
| Doc PR        | n/a

The default escaping strategy was set on the Twig Engine and not the Twig Environment. That's a problem under some circumstances (like what #11773 describes), but it's also much better to set everything on the Twig  Environment directly.

Commits
-------

91b24e8 [TwigBundle] Moved the setting of the default escaping strategy from the Twig engine to the Twig environment

if ('txt' === $format) {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

What about supporting .css.twig too ? Twig supports the css escaping context too.

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.

2 participants