From 3da24d9fda80bd2c3e8a36ea5498fa1fd1c1fa74 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Thu, 30 Jun 2011 11:26:25 +0100 Subject: [PATCH] Fixed logic and implemented normal array key return. --- twig.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/twig.c b/twig.c index f365ab7..21d8ec8 100644 --- a/twig.c +++ b/twig.c @@ -397,15 +397,18 @@ PHP_FUNCTION(twig_template_get_attributes) return $object[$item]; } */ - if (strcmp("method", type) == 0) { + if (strcmp("method", type) != 0) { if ((TWIG_ARRAY_KEY_EXISTS(object, item)) || (TWIG_INSTANCE_OF(object, zend_ce_arrayaccess) && TWIG_ISSET_ARRAY_ELEMENT(object, item)) ) { + zval *ret; + if (isDefinedTest) { RETURN_TRUE; } - TWIG_RETURN_ARRAY_ELEMENT(object, item); + ret = TWIG_RETURN_ARRAY_ELEMENT(object, item); + RETURN_ZVAL(ret, 0, 1); } /* if (Twig_TemplateInterface::ARRAY_CALL === $type) { -- 1.7.2.5