From: Derick Rethans Date: Thu, 7 Jul 2011 12:05:12 +0000 (+0100) Subject: Check normal property before trying to de-mangle it. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=63e1f1279db915d9ab9de47082bbb5c84ceeaca7;p=web%2Fkonrad%2Ftwig.git Check normal property before trying to de-mangle it. --- 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);