diff options
author | Marcus Boerger <helly@php.net> | 2003-09-05 12:14:03 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-09-05 12:14:03 +0000 |
commit | 34990374e1f7bd00b6557119260b2141e30a222f (patch) | |
tree | eab4bc63e87441735d494b3cbaee02b8b7c3b76a /ext/reflection/php_reflection.c | |
parent | 0e3918732eb62ac325559a0168a6eab12b9e75cd (diff) | |
download | php-git-34990374e1f7bd00b6557119260b2141e30a222f.tar.gz |
Fix reflection_api::__construct() (noticed by Andrey)
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 6e4a93623b..36f33e2351 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2204,6 +2204,8 @@ ZEND_METHOD(reflection_property, export) ZEND_METHOD(reflection_property, __construct) { zval *name, *class; + char *name_str; + int name_len; zval *classname; zval *object; reflection_object *intern; @@ -2213,7 +2215,7 @@ ZEND_METHOD(reflection_property, __construct) zend_property_info *property_info; property_reference *reference; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &class, &name) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &class, &name_str, &name_len) == FAILURE) { return; } @@ -2250,12 +2252,12 @@ ZEND_METHOD(reflection_property, __construct) ZVAL_STRINGL(classname, ce->name, ce->name_length, 1); zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL); - convert_to_string_ex(&name); - zval_add_ref(&name); - zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) name, sizeof(zval *), NULL); - lcname = zend_str_tolower_dup((const char *)Z_STRVAL_P(name), (int) Z_STRLEN_P(name)); + MAKE_STD_ZVAL(name); + ZVAL_STRINGL(name, name_str, name_len, 1); + zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL); + lcname = zend_str_tolower_dup(name_str, name_len); - if (zend_hash_find(&ce->properties_info, lcname, (int)(Z_STRLEN_P(name) + 1), (void **) &property_info) == FAILURE) { + if (zend_hash_find(&ce->properties_info, lcname, name_len + 1, (void **) &property_info) == FAILURE) { efree(lcname); _DO_THROW("Property does not exist"); /* returns out of this function */ |