mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 11:27:00 +00:00
Add the properties as assoc keys, so that hash_find actually works on them.
This commit is contained in:
@@ -437,7 +437,7 @@ static int twig_add_property_to_class(zend_property_info *pptr TSRMLS_DC, int nu
|
|||||||
|
|
||||||
zend_unmangle_property_name(pptr->name, pptr->name_length, &class_name, &prop_name);
|
zend_unmangle_property_name(pptr->name, pptr->name_length, &class_name, &prop_name);
|
||||||
|
|
||||||
add_next_index_string(retval, prop_name, 1);
|
add_assoc_string(retval, prop_name, prop_name, 1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -456,7 +456,7 @@ static int twig_add_dyn_property_to_class(zval **pptr TSRMLS_DC, int num_args, v
|
|||||||
ZVAL_STRINGL(&member, hash_key->arKey, hash_key->nKeyLength-1, 0);
|
ZVAL_STRINGL(&member, hash_key->arKey, hash_key->nKeyLength-1, 0);
|
||||||
if (zend_get_property_info(ce, &member, 1 TSRMLS_CC) == &EG(std_property_info)) {
|
if (zend_get_property_info(ce, &member, 1 TSRMLS_CC) == &EG(std_property_info)) {
|
||||||
zend_unmangle_property_name((&EG(std_property_info))->name, (&EG(std_property_info))->name_length, &class_name, &prop_name);
|
zend_unmangle_property_name((&EG(std_property_info))->name, (&EG(std_property_info))->name_length, &class_name, &prop_name);
|
||||||
add_next_index_string(retval, prop_name, 1);
|
add_assoc_string(retval, prop_name, prop_name, 1);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user