]> granicus.if.org Git - php/commitdiff
Do case-insensitive class name matching when parsing
authorAndrei Zmievski <andrei@php.net>
Wed, 28 Feb 2001 03:53:00 +0000 (03:53 +0000)
committerAndrei Zmievski <andrei@php.net>
Wed, 28 Feb 2001 03:53:00 +0000 (03:53 +0000)
array('Class', 'method') structure.
You guys can clean it up, if there is a better way.

Zend/zend_execute_API.c

index 52da3d034da5582b26c8fe794830b37dc15838d7..85a2a12e92ac3627d43fcad66bab2e3de40deebf 100644 (file)
@@ -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;