Added isSandbox check around the __toString check
authorScott Smith <scsmith@ebuyer.com>
Tue, 15 Apr 2014 16:21:28 +0000 (17:21 +0100)
committerScott Smith <scsmith@ebuyer.com>
Tue, 15 Apr 2014 16:21:28 +0000 (17:21 +0100)
lib/Twig/Extension/Sandbox.php

index c59609f..c58259c 100644 (file)
@@ -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');
         }