From b0ef896f0e4f00ae454412dcd4edd472a71bfb1c Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Mon, 16 Feb 2004 00:34:23 +0000 Subject: [PATCH] Bugfix #27227 Mixed case class names causes Fatal Error in Constructor call --- Zend/zend_compile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 256f9f5bdfe..d06ca63996d 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1669,11 +1669,13 @@ static void do_inherit_parent_constructor(zend_class_entry *ce) } else { /* don't inherit the old style constructor if we already have the new style cconstructor */ if (!zend_hash_exists(&ce->function_table, ce->name, ce->name_length+1)) { - if (zend_hash_find(&ce->parent->function_table, ce->parent->name, ce->parent->name_length+1, (void **)&function)==SUCCESS) { + char *lcname = zend_str_tolower_dup(ce->parent->name, ce->parent->name_length); + if (zend_hash_find(&ce->parent->function_table, lcname, ce->parent->name_length+1, (void **)&function)==SUCCESS) { /* inherit parent's constructor */ zend_hash_update(&ce->function_table, ce->name, ce->name_length+1, function, sizeof(zend_function), NULL); function_add_ref(function); } + efree(lcname); } } ce->constructor = ce->parent->constructor;