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

Update for Twig 2.7: Template -> TemplateWrapper #955

Closed
wants to merge 2 commits into from
Closed

Update for Twig 2.7: Template -> TemplateWrapper #955

wants to merge 2 commits into from

Conversation

bobdenotter
Copy link
Contributor

@bobdenotter bobdenotter commented Mar 13, 2019

Since Twig 2.7, $twig->resolveTemplate($template) doesn't return Twig\Template but Twig\TemplateWrapper. This PR simply updates the typehints accordingly.

@bobdenotter
Copy link
Contributor Author

Also, I've updated the composer dependencies, because it wouldn't install otherwise since the vulnerability disclosure in Twig 2.6.

@EnriqueGF
Copy link

Thank's you!

@@ -5045,16 +5169,16 @@
},
{
"name": "twig/twig",
"version": "v2.6.2",
"version": "v2.7.2",

Choose a reason for hiding this comment

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

👍 Also waiting for CVE-NONE-0001 fix to be merged to master.

@javiereguiluz
Copy link
Member

Thanks for fixing this bug Bob.

@Spreeuw
Copy link

Spreeuw commented Apr 24, 2019

Has this bug been reintroduced with later versions of Twig? I have 2.8.1 and got the inverse error:

Argument 1 passed to App\Twig\SourceCodeExtension::getTemplateSource() must be an instance of Twig\TemplateWrapper, instance of __TwigTemplate_162c098ca5b32414d11a6bd21c615e86daeea569ccab9c2c836dc6159b60cd1f given

Reverting the changes in src/Twig/SourceCodeExtension.php resolved the issue for me...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants