From 8e91d46481cfd65a6d80eff7b5e7cd912fc94c6e Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Sun, 1 Nov 2009 15:12:34 +0000 Subject: - Fixed bug #49719 (ReflectionClass::hasProperty returns true for a private property in base class) --- ext/reflection/php_reflection.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'ext/reflection/php_reflection.c') 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)) { -- cgit v1.2.1