Check normal property before trying to de-mangle it.
authorDerick Rethans <github@derickrethans.nl>
Thu, 7 Jul 2011 12:05:12 +0000 (13:05 +0100)
committerDerick Rethans <github@derickrethans.nl>
Thu, 7 Jul 2011 12:05:12 +0000 (13:05 +0100)
twig.c

diff --git a/twig.c b/twig.c
index 224cd94..7cf7ad7 100644 (file)
--- 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);