summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>2001-02-28 03:53:00 +0000
committerAndrei Zmievski <andrei@php.net>2001-02-28 03:53:00 +0000
commit145a319f430b18144f095cb0d18a1489f20c130a (patch)
tree281e0d72614233d03d0ed2103d6032387f361e10
parent0e729b502fa34cd416429ebc317f803f2ab4b4fa (diff)
downloadphp-git-145a319f430b18144f095cb0d18a1489f20c130a.tar.gz
Do case-insensitive class name matching when parsing
array('Class', 'method') structure. You guys can clean it up, if there is a better way.
-rw-r--r--Zend/zend_execute_API.c10
1 files changed, 8 insertions, 2 deletions
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;