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

Fix "include(template_from_string())" when not using a sandbox #3413

Merged
merged 2 commits into from Oct 27, 2020

Conversation

fabpot
Copy link
Contributor

@fabpot fabpot commented Oct 26, 2020

Closed #3411

$template->unwrap()->checkSecurity();
// if a Template instance is passed, it might have been instantiated outside of a sandbox, check security
if ($template instanceof TemplateWrapper || $template instanceof Template) {
$template->unwrap()->checkSecurity();
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this check also be done when the sandbox is already active, even if the $sandboxed argument is not explicitly set to true ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In that case, the check has already been done.

@fabpot
Copy link
Contributor Author

fabpot commented Oct 27, 2020

I've fixed another use case (when you pass an array of templates). /cc @stof

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

Successfully merging this pull request may close these issues.

None yet

2 participants