1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00

fix zend_register_functions() not displaying duplicate functions (reported by Gopal)

This commit is contained in:
Antony Dovgal
2008-08-22 14:51:19 +00:00
parent 1819b9dbea
commit dcb76bf143

View File

@@ -2286,9 +2286,13 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
efree(lc_class_name.v);
}
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 - %v%s%s", scope ? scope->name : EMPTY_ZSTR, scope ? "::" : "", ptr->fname);
}
efree(lowercase_name);
ptr++;
}
zend_unregister_functions(functions, count, target_function_table TSRMLS_CC);