diff options
author | Marcus Boerger <helly@php.net> | 2008-01-16 14:21:07 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2008-01-16 14:21:07 +0000 |
commit | 626881d9e8cb296742d42b804e321056b0a96fc9 (patch) | |
tree | a762f98ca4b21b439e04ad763e97c4bb9d0736c7 /ext/reflection/php_reflection.c | |
parent | 516a9c15d63b6e4fc06fed02db8dfd445ec43c19 (diff) | |
download | php-git-626881d9e8cb296742d42b804e321056b0a96fc9.tar.gz |
- MFH Fixed Bug #37964 (Reflection shows private methods of parent class)
(felipe@php.net)
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 8c19b71d03..d491784600 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -519,7 +519,8 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in zend_hash_internal_pointer_reset_ex(&ce->function_table, &pos); while (zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == SUCCESS) { - if (!(mptr->common.fn_flags & ZEND_ACC_STATIC)) { + if ((mptr->common.fn_flags & ZEND_ACC_STATIC) == 0 && + ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce)) { char *key; uint key_len; ulong num_index; @@ -539,6 +540,9 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in zend_hash_move_forward_ex(&ce->function_table, &pos); } string_printf(str, "\n%s - Methods [%d] {", indent, count); + if (!count) { + string_printf(str, "\n"); + } string_append(str, &dyn); string_free(&dyn); } else { |