From: Fabien Potencier Date: Sat, 18 Dec 2010 13:31:15 +0000 (+0100) Subject: made macros callable when sandbox mode is enabled X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=c66cfa1d6e8e0780bd9a1f0e202674b7a9410b78;p=web%2Fkonrad%2Ftwig.git made macros callable when sandbox mode is enabled --- diff --git a/CHANGELOG b/CHANGELOG index fd6450f..a5e1528 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,7 @@ Backward incompatibilities: Changes: + * made macros callable when sandbox mode is enabled * added an exception when a macro uses a reserved name * the "default" filter now uses the "empty" test instead of just checking for null * added the "empty" test diff --git a/lib/Twig/Sandbox/SecurityPolicy.php b/lib/Twig/Sandbox/SecurityPolicy.php index df97cfe..523fffc 100644 --- a/lib/Twig/Sandbox/SecurityPolicy.php +++ b/lib/Twig/Sandbox/SecurityPolicy.php @@ -67,6 +67,10 @@ class Twig_Sandbox_SecurityPolicy implements Twig_Sandbox_SecurityPolicyInterfac public function checkMethodAllowed($obj, $method) { + if ($obj instanceof Twig_Template) { + return true; + } + $allowed = false; foreach ($this->allowedMethods as $class => $methods) { if ($obj instanceof $class) {