diff options
author | Felipe Pena <felipe@php.net> | 2009-11-01 15:12:34 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2009-11-01 15:12:34 +0000 |
commit | 8e91d46481cfd65a6d80eff7b5e7cd912fc94c6e (patch) | |
tree | c8f91d983629b61377ba3cd381fbb80665e2049f /ext/reflection/php_reflection.c | |
parent | 94cb01177a4cb79ced4d56b8724254a1b9ed2304 (diff) | |
download | php-git-8e91d46481cfd65a6d80eff7b5e7cd912fc94c6e.tar.gz |
- Fixed bug #49719 (ReflectionClass::hasProperty returns true for a private property in base class)
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index a1ee0d6eb1..9589307f04 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3512,6 +3512,7 @@ ZEND_METHOD(reflection_class, getMethods) ZEND_METHOD(reflection_class, hasProperty) { reflection_object *intern; + zend_property_info *property_info; zend_class_entry *ce; char *name; int name_len; @@ -3523,11 +3524,13 @@ ZEND_METHOD(reflection_class, hasProperty) } GET_REFLECTION_OBJECT_PTR(ce); - if (zend_hash_exists(&ce->properties_info, name, name_len + 1)) { + if (zend_hash_find(&ce->properties_info, name, name_len+1, (void **) &property_info) == SUCCESS) { + if (property_info->flags & ZEND_ACC_SHADOW) { + RETURN_FALSE; + } RETURN_TRUE; } else { - if (intern->obj && Z_OBJ_HANDLER_P(intern->obj, has_property)) - { + if (intern->obj && Z_OBJ_HANDLER_P(intern->obj, has_property)) { MAKE_STD_ZVAL(property); ZVAL_STRINGL(property, name, name_len, 1); if (Z_OBJ_HANDLER_P(intern->obj, has_property)(intern->obj, property, 0 TSRMLS_CC)) { |