--- embedaddon/php/Zend/zend_builtin_functions.c 2013/07/22 01:32:15 1.1.1.3 +++ embedaddon/php/Zend/zend_builtin_functions.c 2013/10/14 08:02:46 1.1.1.4 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_builtin_functions.c,v 1.1.1.3 2013/07/22 01:32:15 misho Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.1.1.4 2013/10/14 08:02:46 misho Exp $ */ #include "zend.h" #include "zend_API.h" @@ -1399,15 +1399,8 @@ ZEND_FUNCTION(class_alias) return; } - if (!autoload) { - lc_name = do_alloca(class_name_len + 1, use_heap); - zend_str_tolower_copy(lc_name, class_name, class_name_len); + found = zend_lookup_class_ex(class_name, class_name_len, NULL, autoload, &ce TSRMLS_CC); - found = zend_hash_find(EG(class_table), lc_name, class_name_len+1, (void **) &ce); - free_alloca(lc_name, use_heap); - } else { - found = zend_lookup_class(class_name, class_name_len, &ce TSRMLS_CC); - } if (found == SUCCESS) { if ((*ce)->type == ZEND_USER_CLASS) { if (zend_register_class_alias_ex(alias_name, alias_name_len, *ce TSRMLS_CC) == SUCCESS) { @@ -1926,6 +1919,11 @@ static int add_constant_info(zend_constant *constant, zval *name_array = (zval *)arg; zval *const_val; + if (!constant->name) { + /* skip special constants */ + return 0; + } + MAKE_STD_ZVAL(const_val); *const_val = constant->value; zval_copy_ctor(const_val); @@ -1993,11 +1991,16 @@ ZEND_FUNCTION(get_defined_constants) while (zend_hash_get_current_data_ex(EG(zend_constants), (void **) &val, &pos) != FAILURE) { zval *const_val; + if (!val->name) { + /* skip special constants */ + goto next_constant; + } + if (val->module_number == PHP_USER_CONSTANT) { module_number = i; } else if (val->module_number > i || val->module_number < 0) { /* should not happen */ - goto bad_module_id; + goto next_constant; } else { module_number = val->module_number; } @@ -2014,7 +2017,7 @@ ZEND_FUNCTION(get_defined_constants) INIT_PZVAL(const_val); add_assoc_zval_ex(modules[module_number], val->name, val->name_len, const_val); -bad_module_id: +next_constant: zend_hash_move_forward_ex(EG(zend_constants), &pos); } efree(module_names); @@ -2386,7 +2389,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_ MAKE_STD_ZVAL(arg_array); array_init(arg_array); - /* include_filename always points to the last filename of the last last called-fuction. + /* include_filename always points to the last filename of the last last called-function. if we have called include in the frame above - this is the file we have included. */