summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-10-02 12:16:35 +0000
committerAntony Dovgal <tony2001@php.net>2006-10-02 12:16:35 +0000
commitc356ad3b65709d41c2b5030c252bc54b7295daa3 (patch)
tree254c98c28a1a47c5177d6d9d6be94734648e195e /ext/reflection/php_reflection.c
parent2b1b2db8ec8d5ef26da2ec671d163182f72f1206 (diff)
downloadphp-git-c356ad3b65709d41c2b5030c252bc54b7295daa3.tar.gz
MFH: #39001 (ReflectionProperty returns incorrect declaring class for protected properties)
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 65ad634949..d7d17f7618 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -4008,14 +4008,21 @@ ZEND_METHOD(reflection_property, getDeclaringClass)
property_reference *ref;
zend_class_entry *tmp_ce, *ce;
zend_property_info *tmp_info;
+ char *prop_name, *class_name;
+ int prop_name_len;
METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0);
GET_REFLECTION_OBJECT_PTR(ref);
+ if (zend_unmangle_property_name(ref->prop->name, ref->prop->name_length, &class_name, &prop_name) != SUCCESS) {
+ RETURN_FALSE;
+ }
+
+ prop_name_len = strlen(prop_name);
ce = tmp_ce = ref->ce;
- while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, ref->prop->name, ref->prop->name_length + 1, (void **) &tmp_info) == SUCCESS) {
+ while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, prop_name, prop_name_len + 1, (void **) &tmp_info) == SUCCESS) {
ce = tmp_ce;
- tmp_ce = tmp_ce->parent;
+ tmp_ce = tmp_ce->parent;
}
zend_reflection_class_factory(ce, return_value TSRMLS_CC);