From 52b9ae44bb05d6e45f93969e81a630dd875acecb Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Wed, 13 Jul 2011 16:27:35 +0100 Subject: [PATCH] Bailout when we have an exception to defer to PHP's exception handlers. --- twig.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/twig.c b/twig.c index 7712d93..b641bd0 100644 --- a/twig.c +++ b/twig.c @@ -736,6 +736,9 @@ PHP_FUNCTION(twig_template_get_attributes) if (TWIG_CALL_SB(TWIG_PROPERTY_CHAR(template, "env"), "hasExtension", "sandbox")) { TWIG_CALL_ZZ(TWIG_CALL_S(TWIG_PROPERTY_CHAR(template, "env"), "getExtension", "sandbox"), "checkPropertyAllowed", object, item); } + if (EG(exception)) { + return; + } convert_to_string(item); ret = TWIG_PROPERTY(object, item); @@ -818,6 +821,9 @@ PHP_FUNCTION(twig_template_get_attributes) if (TWIG_CALL_SB(TWIG_PROPERTY_CHAR(template, "env"), "hasExtension", "sandbox")) { TWIG_CALL_ZZ(TWIG_CALL_S(TWIG_PROPERTY_CHAR(template, "env"), "getExtension", "sandbox"), "checkMethodAllowed", object, item); } + if (EG(exception)) { + return; + } /* $ret = call_user_func_array(array($object, $method), $arguments); */ -- 1.7.2.5