cvs: ZendEngine2 / zend_API.c

[email protected] ("Antony Dovgal")
Newsgroups php.zend-engine.cvs
Message-ID <cvstony20011219416679@cvsserver>
tony2001		Fri Aug 22 14:51:19 2008 UTC

  Modified files:              
    /ZendEngine2	zend_API.c 
  Log:
  fix zend_register_functions() not displaying duplicate functions (reported by Gopal)
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.488&r2=1.489&diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.488 ZendEngine2/zend_API.c:1.489
--- ZendEngine2/zend_API.c:1.488	Thu Aug 14 21:26:05 2008
+++ ZendEngine2/zend_API.c	Fri Aug 22 14:51:19 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_API.c,v 1.488 2008/08/14 21:26:05 colder Exp $ */
+/* $Id: zend_API.c,v 1.489 2008/08/22 14:51:19 tony2001 Exp $ */
 
 #include "zend.h"
 #include "zend_execute.h"
@@ -2286,9 +2286,13 @@
 			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);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.