]> granicus.if.org Git - php/commitdiff
MFH Bugfix # 30209
authorMarcus Boerger <helly@php.net>
Thu, 23 Sep 2004 18:41:15 +0000 (18:41 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 23 Sep 2004 18:41:15 +0000 (18:41 +0000)
Zend/zend_reflection_api.c
ext/reflection/php_reflection.c

index 6e8cd6d534a667da1f7ac096e63b95b4b5e8fb7d..eb8bf648bea04dc82e72137bdc7e020669708efa 100644 (file)
@@ -2159,7 +2159,7 @@ ZEND_METHOD(reflection_class, getMethod)
        reflection_object *intern;
        zend_class_entry *ce;
        zend_function *mptr;
-       char *name; 
+       char *name, *lc_name
        int name_len;
 
        METHOD_NOTSTATIC;
@@ -2168,10 +2168,12 @@ ZEND_METHOD(reflection_class, getMethod)
        }
 
        GET_REFLECTION_OBJECT_PTR(ce);
-       zend_str_tolower(name, name_len);
-       if (zend_hash_find(&ce->function_table, name, name_len + 1, (void**) &mptr) == SUCCESS) {
+       lc_name = zend_str_tolower_dup(name, name_len);
+       if (zend_hash_find(&ce->function_table, lc_name, name_len + 1, (void**) &mptr) == SUCCESS) {
                reflection_method_factory(ce, mptr, return_value TSRMLS_CC);
+               efree(lc_name);
        } else {
+               efree(lc_name);
                zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                "Method %s does not exist", name);
                return;
index 6e8cd6d534a667da1f7ac096e63b95b4b5e8fb7d..eb8bf648bea04dc82e72137bdc7e020669708efa 100644 (file)
@@ -2159,7 +2159,7 @@ ZEND_METHOD(reflection_class, getMethod)
        reflection_object *intern;
        zend_class_entry *ce;
        zend_function *mptr;
-       char *name; 
+       char *name, *lc_name
        int name_len;
 
        METHOD_NOTSTATIC;
@@ -2168,10 +2168,12 @@ ZEND_METHOD(reflection_class, getMethod)
        }
 
        GET_REFLECTION_OBJECT_PTR(ce);
-       zend_str_tolower(name, name_len);
-       if (zend_hash_find(&ce->function_table, name, name_len + 1, (void**) &mptr) == SUCCESS) {
+       lc_name = zend_str_tolower_dup(name, name_len);
+       if (zend_hash_find(&ce->function_table, lc_name, name_len + 1, (void**) &mptr) == SUCCESS) {
                reflection_method_factory(ce, mptr, return_value TSRMLS_CC);
+               efree(lc_name);
        } else {
+               efree(lc_name);
                zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                "Method %s does not exist", name);
                return;