diff options
author | Felipe Pena <felipe@php.net> | 2009-08-01 20:44:00 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2009-08-01 20:44:00 +0000 |
commit | c75f162165bc3bc144dbe7ddfd4638f0e910e3de (patch) | |
tree | f37bc9c62d4ef5706550bddec2f9af2d7be87758 /ext/reflection/php_reflection.c | |
parent | ade24c7e355cf65874d10c9d72bb7710919b0084 (diff) | |
download | php-git-c75f162165bc3bc144dbe7ddfd4638f0e910e3de.tar.gz |
- Fixed ReflectionClass::getStaticProperties() to do not return the private properties from parent class;
behavior already adopted in ReflectionClass::getDefaultProperties() and ReflectionClass::getProperties().
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 8999c19994..7dfc0c86ea 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3060,13 +3060,16 @@ ZEND_METHOD(reflection_class, getStaticProperties) zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name); - /* copy: enforce read only access */ - ALLOC_ZVAL(prop_copy); - *prop_copy = **value; - zval_copy_ctor(prop_copy); - INIT_PZVAL(prop_copy); + /* filter privates from base classes */ + if (!(class_name && class_name[0] != '*' && strcmp(class_name, ce->name))) { + /* copy: enforce read only access */ + ALLOC_ZVAL(prop_copy); + *prop_copy = **value; + zval_copy_ctor(prop_copy); + INIT_PZVAL(prop_copy); - add_assoc_zval(return_value, prop_name, prop_copy); + add_assoc_zval(return_value, prop_name, prop_copy); + } } zend_hash_move_forward_ex(CE_STATIC_MEMBERS(ce), &pos); } |