From: Andrei Zmievski Date: Wed, 28 Feb 2001 03:53:00 +0000 (+0000) Subject: Do case-insensitive class name matching when parsing X-Git-Tag: php-4.0.5RC1~139 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=145a319f430b18144f095cb0d18a1489f20c130a;p=php Do case-insensitive class name matching when parsing array('Class', 'method') structure. You guys can clean it up, if there is a better way. --- diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 52da3d034d..85a2a12e92 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -372,8 +372,14 @@ int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *fun function_table = &(*object_pp)->value.obj.ce->function_table; } else if (Z_TYPE_PP(object_pp) == IS_STRING) { zend_class_entry *ce; - - if (zend_hash_find(EG(class_table), Z_STRVAL_PP(object_pp), Z_STRLEN_PP(object_pp) + 1, (void **) &ce)==FAILURE) + char *lc_class; + int found; + + lc_class = estrndup(Z_STRVAL_PP(object_pp), Z_STRLEN_PP(object_pp)); + zend_str_tolower(lc_class, Z_STRLEN_PP(object_pp)); + found = zend_hash_find(EG(class_table), lc_class, Z_STRLEN_PP(object_pp) + 1, (void **) &ce); + efree(lc_class); + if (found == FAILURE) return FAILURE; function_table = &ce->function_table;