From 63e1f1279db915d9ab9de47082bbb5c84ceeaca7 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Thu, 7 Jul 2011 13:05:12 +0100 Subject: [PATCH] Check normal property before trying to de-mangle it. --- twig.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/twig.c b/twig.c index 224cd94..7cf7ad7 100644 --- a/twig.c +++ b/twig.c @@ -314,6 +314,12 @@ zval *TWIG_PROPERTY(zval *object, char *propname) { char *prot_name; int prot_name_length; + zval *tmp; + + tmp = TWIG_GET_ARRAY_ELEMENT(object, propname, strlen(propname)); + if (tmp) { + return tmp; + } zend_mangle_property_name(&prot_name, &prot_name_length, "*", 1, propname, strlen(propname), 0); return TWIG_GET_ARRAY_ELEMENT(object, prot_name, prot_name_length); -- 1.7.2.5