From 8dfa4325df669add82c385cd3860f5c7c7a6446a Mon Sep 17 00:00:00 2001 From: Scott Smith Date: Tue, 15 Apr 2014 17:21:28 +0100 Subject: [PATCH] Added isSandbox check around the __toString check --- lib/Twig/Extension/Sandbox.php | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/Twig/Extension/Sandbox.php b/lib/Twig/Extension/Sandbox.php index c59609f..c58259c 100644 --- a/lib/Twig/Extension/Sandbox.php +++ b/lib/Twig/Extension/Sandbox.php @@ -93,7 +93,7 @@ class Twig_Extension_Sandbox extends Twig_Extension public function ensureToStringAllowed($obj) { - if (is_object($obj)) { + if ($this->isSandboxed() && is_object($obj)) { $this->policy->checkMethodAllowed($obj, '__toString'); } -- 1.7.2.5