Fix the handling of internal Twig_Template properties in the C ext

This commit is contained in:
Christophe Coevoet
2015-08-12 15:00:46 +02:00
committed by Fabien Potencier
parent a8a125ba9b
commit e000420096
+2 -2
View File
@@ -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);