From: Antony Dovgal Date: Fri, 22 Aug 2008 14:52:47 +0000 (+0000) Subject: MFH: fix zend_register_functions() not displaying duplicate functions (reported by... X-Git-Tag: php-5.2.7RC1~84 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=72daf80c47dc08e70af901f6a47abdf21ad23cb5;p=php MFH: fix zend_register_functions() not displaying duplicate functions (reported by Gopal) --- diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 2be99be254..2cdd6846fd 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1779,9 +1779,13 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr efree(lc_class_name); } while (ptr->fname) { - if (zend_hash_exists(target_function_table, ptr->fname, strlen(ptr->fname)+1)) { + fname_len = strlen(ptr->fname); + lowercase_name = zend_str_tolower_dup(ptr->fname, fname_len); + if (zend_hash_exists(target_function_table, lowercase_name, fname_len+1)) { + efree(lowercase_name); zend_error(error_type, "Function registration failed - duplicate name - %s%s%s", scope ? scope->name : "", scope ? "::" : "", ptr->fname); } + efree(lowercase_name); ptr++; } zend_unregister_functions(functions, count, target_function_table TSRMLS_CC);