summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-12-21 20:05:24 +0000
committerMarcus Boerger <helly@php.net>2005-12-21 20:05:24 +0000
commitfe3f66e18855efc1e7d05f2ee4ccecfc1af55dfd (patch)
treedbf61f821a61a2bae992d4f32292a8e7a7a2efdc
parent8710b8c5f5ce36542432a913750942cbbf48e6c6 (diff)
downloadphp-git-fe3f66e18855efc1e7d05f2ee4ccecfc1af55dfd.tar.gz
- We need to store the length of the class name
-rwxr-xr-xext/spl/php_spl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 3d10631eaa..cb7f34f369 100755
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -341,6 +341,7 @@ static void autoload_func_info_dtor(autoload_func_info *alfi)
PHP_FUNCTION(spl_autoload_call)
{
zval **class_name, *retval = NULL;
+ int class_name_len;
char *func_name, *lc_name;
uint func_name_len;
ulong dummy;
@@ -352,7 +353,8 @@ PHP_FUNCTION(spl_autoload_call)
}
if (SPL_G(autoload_functions)) {
- lc_name = zend_str_tolower_dup(Z_STRVAL_PP(class_name), Z_STRLEN_PP(class_name));
+ class_name_len = Z_STRLEN_PP(class_name);
+ lc_name = zend_str_tolower_dup(Z_STRVAL_PP(class_name), class_name_len);
zend_hash_internal_pointer_reset_ex(SPL_G(autoload_functions), &function_pos);
while(zend_hash_has_more_elements_ex(SPL_G(autoload_functions), &function_pos) == SUCCESS && !EG(exception)) {
zend_hash_get_current_key_ex(SPL_G(autoload_functions), &func_name, &func_name_len, &dummy, 0, &function_pos);
@@ -361,7 +363,7 @@ PHP_FUNCTION(spl_autoload_call)
if (retval) {
zval_ptr_dtor(&retval);
}
- if (zend_hash_exists(EG(class_table), lc_name, Z_STRLEN_PP(class_name)+1)) {
+ if (zend_hash_exists(EG(class_table), lc_name, class_name_len + 1)) {
break;
}
zend_hash_move_forward_ex(SPL_G(autoload_functions), &function_pos);