diff options
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r-- | Zend/zend_builtin_functions.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 785709f51b..0d45d5a32e 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -789,7 +789,7 @@ ZEND_FUNCTION(get_object_vars) char *key, *prop_name, *class_name; uint key_len; ulong num_index; - int instanceof; + zend_object *zobj; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &obj) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); @@ -808,7 +808,7 @@ ZEND_FUNCTION(get_object_vars) RETURN_FALSE; } - instanceof = EG(This) && instanceof_function(Z_OBJCE_P(EG(This)), Z_OBJCE_PP(obj) TSRMLS_CC); + zobj = zend_objects_get_address(*obj TSRMLS_CC); array_init(return_value); @@ -816,17 +816,11 @@ ZEND_FUNCTION(get_object_vars) while (zend_hash_get_current_data_ex(properties, (void **) &value, &pos) == SUCCESS) { if (zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0, &pos) == HASH_KEY_IS_STRING) { - if (key[0]) { + if (zend_check_property_access(zobj, key, key_len-1 TSRMLS_CC) == SUCCESS) { + zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name); /* Not separating references */ (*value)->refcount++; - add_assoc_zval_ex(return_value, key, key_len, *value); - } else if (instanceof) { - zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name); - if (!memcmp(class_name, "*", 2) || (Z_OBJCE_P(EG(This)) == Z_OBJCE_PP(obj) && !strcmp(Z_OBJCE_P(EG(This))->name, class_name))) { - /* Not separating references */ - (*value)->refcount++; - add_assoc_zval_ex(return_value, prop_name, strlen(prop_name)+1, *value); - } + add_assoc_zval_ex(return_value, prop_name, strlen(prop_name)+1, *value); } } zend_hash_move_forward_ex(properties, &pos); |