From e000420096de342f3384d857bedee8295d03f973 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Wed, 12 Aug 2015 15:00:46 +0200 Subject: [PATCH] Fix the handling of internal Twig_Template properties in the C ext --- ext/twig/twig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/twig/twig.c b/ext/twig/twig.c index 41b2c8f36..07843bd79 100644 --- a/ext/twig/twig.c +++ b/ext/twig/twig.c @@ -898,7 +898,7 @@ PHP_FUNCTION(twig_template_get_attributes) /* // object property - if (Twig_Template::METHOD_CALL !== $type) { + if (Twig_Template::METHOD_CALL !== $type && !$object instanceof Twig_Template) { if (isset($object->$item) || array_key_exists((string) $item, $object)) { if ($isDefinedTest) { return true; @@ -912,7 +912,7 @@ PHP_FUNCTION(twig_template_get_attributes) } } */ - if (strcmp("method", type) != 0) { + if (strcmp("method", type) != 0 && !TWIG_INSTANCE_OF_USERLAND(object, "Twig_Template" TSRMLS_CC)) { zval *tmp_properties, *tmp_item; tmp_properties = TWIG_GET_ARRAY_ELEMENT(tmp_class, "properties", strlen("properties") TSRMLS_CC);