johannes Sat Oct 21 10:01:39 2006 UTC Modified files: /php-src/main php_variables.c Log: - Fix merging of $_REQUEST in unicode mode and remove $GLOBALS check from register_globals times http://cvs.php.net/viewvc.cgi/php-src/main/php_variables.c?r1=1.131&r2=1.132&diff_format=u Index: php-src/main/php_variables.c diff -u php-src/main/php_variables.c:1.131 php-src/main/php_variables.c:1.132 --- php-src/main/php_variables.c:1.131 Tue Sep 19 10:38:31 2006 +++ php-src/main/php_variables.c Sat Oct 21 10:01:39 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_variables.c,v 1.131 2006/09/19 10:38:31 dmitry Exp $ */ +/* $Id: php_variables.c,v 1.132 2006/10/21 10:01:39 johannes Exp $ */ #include <stdio.h> #include "php.h" @@ -770,20 +770,14 @@ zend_hash_internal_pointer_reset_ex(src, &pos); while (zend_hash_get_current_data_ex(src, (void **)&src_entry, &pos) == SUCCESS) { key_type = zend_hash_get_current_key_ex(src, &string_key, &string_key_len, &num_key, 0, &pos); - /* FIXME: Unicode support??? */ if (Z_TYPE_PP(src_entry) != IS_ARRAY - || (key_type == HASH_KEY_IS_STRING && zend_u_hash_find(dest, key_type, string_key, string_key_len, (void **) &dest_entry) != SUCCESS) + || ((key_type == HASH_KEY_IS_UNICODE || key_type == HASH_KEY_IS_STRING) && zend_u_hash_find(dest, key_type, string_key, string_key_len, (void **) &dest_entry) != SUCCESS) || (key_type == HASH_KEY_IS_LONG && zend_hash_index_find(dest, num_key, (void **)&dest_entry) != SUCCESS) || Z_TYPE_PP(dest_entry) != IS_ARRAY ) { (*src_entry)->refcount++; - if (key_type == HASH_KEY_IS_STRING) { - /* prevent overwriting of GLOBALS */ - if (string_key_len != sizeof("GLOBALS") || memcmp(string_key.s, "GLOBALS", sizeof("GLOBALS") - 1)) { - zend_u_hash_update(dest, key_type, string_key, string_key_len, src_entry, sizeof(zval *), NULL); - } else { - (*src_entry)->refcount--; - } + if (key_type == HASH_KEY_IS_STRING || key_type == HASH_KEY_IS_UNICODE) { + zend_u_hash_update(dest, key_type, string_key, string_key_len, src_entry, sizeof(zval *), NULL); } else { zend_hash_index_update(dest, num_key, src_entry, sizeof(zval *), NULL); }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php