]> granicus.if.org Git - php/commitdiff
fix zend_register_functions() not displaying duplicate functions (reported by Gopal)
authorAntony Dovgal <tony2001@php.net>
Fri, 22 Aug 2008 14:51:19 +0000 (14:51 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 22 Aug 2008 14:51:19 +0000 (14:51 +0000)
Zend/zend_API.c

index 4db7c79dfa2941797ea968a4cb5c139ff9dfe1f7..988a305407527e69733b32939b462d6a4a5180ab 100644 (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);