diff options
author | Andi Gutmans <andi@php.net> | 2004-02-29 18:31:29 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2004-02-29 18:31:29 +0000 |
commit | 37ddf8e922fc971abaef3a73daf15c3cce5bcc7f (patch) | |
tree | 0e5e6bb7d0ff1fe5c735181bbf07010c00865bc6 /ext/reflection/php_reflection.c | |
parent | 63e263f32a04b37d605ca48897a428fd10737244 (diff) | |
download | php-git-37ddf8e922fc971abaef3a73daf15c3cce5bcc7f.tar.gz |
- Apply fixes by Timm.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 0d4dd48eb9..c71044df04 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1800,9 +1800,9 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob zval_add_ref(&argument); } } else { + convert_to_string_ex(&argument); if (zend_lookup_class(Z_STRVAL_P(argument), Z_STRLEN_P(argument), &ce TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, - "Class %s does not exist", Z_STRVAL_P(argument)); + zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Class %s does not exist", Z_STRVAL_P(argument)); return; } @@ -2302,6 +2302,11 @@ ZEND_METHOD(reflection_class, newInstance) zend_fcall_info fci; zend_fcall_info_cache fcc; + if (!(ce->constructor->common.fn_flags & ZEND_ACC_PUBLIC)) { + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Access to non-public constructor of class %s", ce->name); + return; + } + params = safe_emalloc(sizeof(zval **), argc, 0); if (zend_get_parameters_array_ex(argc, params) == FAILURE) { efree(params); |