Bailout when we have an exception to defer to PHP's exception handlers.
authorDerick Rethans <github@derickrethans.nl>
Wed, 13 Jul 2011 15:27:35 +0000 (16:27 +0100)
committerDerick Rethans <github@derickrethans.nl>
Wed, 13 Jul 2011 15:27:35 +0000 (16:27 +0100)
twig.c

diff --git a/twig.c b/twig.c
index 7712d93..b641bd0 100644 (file)
--- 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);
 */