diff options
| author | Felipe Pena <felipe@php.net> | 2008-06-03 18:11:12 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2008-06-03 18:11:12 +0000 |
| commit | cc23d3bade433999c6adb007d9d779ed6ddb7f98 (patch) | |
| tree | cc7efdb456f7d138a2ef1a7c8f9a3498b0cd913c /Zend/zend_object_handlers.c | |
| parent | 2b60fdf97635564773d109442c926a582dd9f2d1 (diff) | |
| download | php-git-cc23d3bade433999c6adb007d9d779ed6ddb7f98.tar.gz | |
- Fixed bug #45089 (__callStatic $name case sensitivity)
Diffstat (limited to 'Zend/zend_object_handlers.c')
| -rw-r--r-- | Zend/zend_object_handlers.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 71f843b339..cf5ebd4807 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -893,7 +893,9 @@ ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC) /* {{{ */ { zend_function *fbc = NULL; - char *lc_class_name; + char *lc_class_name, *lc_function_name = NULL; + + lc_function_name = zend_str_tolower_dup(function_name_strval, function_name_strlen); if (function_name_strlen == ce->name_length && ce->constructor) { lc_class_name = zend_str_tolower_dup(ce->name, ce->name_length); @@ -902,7 +904,9 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f } efree(lc_class_name); } - if (!fbc && zend_hash_find(&ce->function_table, function_name_strval, function_name_strlen+1, (void **) &fbc)==FAILURE) { + if (!fbc && zend_hash_find(&ce->function_table, lc_function_name, function_name_strlen+1, (void **) &fbc)==FAILURE) { + efree(lc_function_name); + if (ce->__call && EG(This) && Z_OBJ_HT_P(EG(This))->get_class_entry && @@ -940,6 +944,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f zend_error(E_ERROR, "Call to undefined method %s::%s()", ce->name ? ce->name : "", function_name_strval); } } + efree(lc_function_name); #if MBO_0 /* right now this function is used for non static method lookup too */ |
