cvs: ZendEngine2(PHP_5_3) / zend_API.c

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

  Modified files:              (Branch: PHP_5_3)
    /ZendEngine2	zend_API.c 
  Log:
  MFH: fix zend_register_functions() not displaying duplicate functions (reported by Gopal)
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.296.2.27.2.34.2.52&r2=1.296.2.27.2.34.2.53&diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.296.2.27.2.34.2.52 ZendEngine2/zend_API.c:1.296.2.27.2.34.2.53
--- ZendEngine2/zend_API.c:1.296.2.27.2.34.2.52	Thu Aug 14 21:36:56 2008
+++ ZendEngine2/zend_API.c	Fri Aug 22 14:51:30 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_API.c,v 1.296.2.27.2.34.2.52 2008/08/14 21:36:56 colder Exp $ */
+/* $Id: zend_API.c,v 1.296.2.27.2.34.2.53 2008/08/22 14:51:30 tony2001 Exp $ */
 
 #include "zend.h"
 #include "zend_execute.h"
@@ -1920,9 +1920,13 @@
 			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);
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.