summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2011-06-11 15:11:49 +0000
committerFelipe Pena <felipe@php.net>2011-06-11 15:11:49 +0000
commitd2c47040f5d410d22fe8b48371be6dc37aa809bd (patch)
treea7b9dd06dc1a966b02c7d576d9ddbb8336604c63 /ext/reflection/php_reflection.c
parentf641cf8b2c35969cf8bbfe7e5f2c0f20f0326dae (diff)
downloadphp-git-d2c47040f5d410d22fe8b48371be6dc37aa809bd.tar.gz
- Missing fix for bug #54347
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 57f8f48c30..850192e84c 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -5097,16 +5097,21 @@ ZEND_METHOD(reflection_extension, getFunctions)
/* Is there a better way of doing this? */
while (func->fname) {
- if (zend_hash_find(EG(function_table), func->fname, strlen(func->fname) + 1, (void**) &fptr) == FAILURE) {
+ int fname_len = strlen(func->fname);
+ char *lc_name = zend_str_tolower_dup(func->fname, fname_len);
+
+ if (zend_hash_find(EG(function_table), lc_name, fname_len + 1, (void**) &fptr) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal error: Cannot find extension function %s in global function table", func->fname);
func++;
+ efree(lc_name);
continue;
}
ALLOC_ZVAL(function);
reflection_function_factory(fptr, NULL, function TSRMLS_CC);
- add_assoc_zval_ex(return_value, func->fname, strlen(func->fname)+1, function);
+ add_assoc_zval_ex(return_value, func->fname, fname_len+1, function);
func++;
+ efree(lc_name);
}
}
}