diff options
| author | Arnaud Le Blanc <lbarnaud@php.net> | 2009-05-22 11:19:30 +0000 |
|---|---|---|
| committer | Arnaud Le Blanc <lbarnaud@php.net> | 2009-05-22 11:19:30 +0000 |
| commit | b33c51693bc0d52bbde7e9bb6d4221782a056bca (patch) | |
| tree | bb460ef18c401bddcd93443c3616b4739ab8932a /Zend/zend_builtin_functions.c | |
| parent | ccd915ff3fb532a35814611976acaaab401aa35d (diff) | |
| download | php-git-b33c51693bc0d52bbde7e9bb6d4221782a056bca.tar.gz | |
MFH: Use zend_get_property_info() in get_class_vars() (fixes #46812)
Diffstat (limited to 'Zend/zend_builtin_functions.c')
| -rw-r--r-- | Zend/zend_builtin_functions.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 4c430274c4..6def986c75 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -890,27 +890,22 @@ static void add_class_vars(zend_class_entry *ce, HashTable *properties, zval *re while (zend_hash_get_current_data_ex(properties, (void **) &prop, &pos) == SUCCESS) { char *key, *class_name, *prop_name; uint key_len; - ulong num_index, h; + ulong num_index; int prop_name_len = 0; zval *prop_copy; zend_property_info *property_info; + zval zprop_name; zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0, &pos); zend_hash_move_forward_ex(properties, &pos); zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name); prop_name_len = strlen(prop_name); - - h = zend_get_hash_value(prop_name, prop_name_len+1); - if (zend_hash_quick_find(&ce->properties_info, prop_name, prop_name_len+1, h, (void **) &property_info) == FAILURE) { - continue; - } - - if (property_info->flags & ZEND_ACC_SHADOW) { - continue; - } else if ((property_info->flags & ZEND_ACC_PRIVATE) && EG(scope) != ce) { - continue; - } else if ((property_info->flags & ZEND_ACC_PROTECTED) && zend_check_protected(ce, EG(scope)) == 0) { + + ZVAL_STRINGL(&zprop_name, prop_name, prop_name_len, 0); + property_info = zend_get_property_info(ce, &zprop_name, 1 TSRMLS_CC); + + if (!property_info || property_info == &EG(std_property_info)) { continue; } |
