From 84f0adff86956860469eeebe167baf620745ba0d Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 22 Feb 2006 13:10:32 +0000 Subject: [PATCH] Unicode support: fixed GLOBALS protection --- ext/standard/array.c | 5 +++-- ext/standard/basic_functions.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 62ab109ea3..38a16316d0 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1438,8 +1438,9 @@ PHP_FUNCTION(extract) /* break omitted intentionally */ case EXTR_OVERWRITE: - /* FIXME: Unicode support??? */ - if (var_exists && !strcmp(var_name.s, "GLOBALS")) { + if (var_exists && + var_name_len == sizeof("GLOBALS") && + ZEND_U_EQUAL(key_type, var_name, var_name_len-1, "GLOBALS", sizeof("GLOBALS")-1)) { break; } diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 577f5a10ad..a065c9b830 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -3179,8 +3179,8 @@ static int copy_request_variable(void *pDest, int num_args, va_list args, zend_h if (!hash_key->nKeyLength) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Numeric key detected - possible security hazard."); return 0; - /* FIXME: Unicode support??? */ - } else if (!strcmp(hash_key->arKey.s, "GLOBALS")) { + } else if (hash_key->nKeyLength == sizeof("GLOBALS") && + ZEND_U_EQUAL(hash_key->type, hash_key->arKey, hash_key->nKeyLength-1, "GLOBALS", sizeof("GLOBALS")-1)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempted GLOBALS variable overwrite."); return 0; } -- 2.50.1