From: Ilia Alshanetsky Date: Tue, 17 Jun 2003 17:15:02 +0000 (+0000) Subject: Handle numeric keys passed via GPC X-Git-Tag: RELEASE_1_0_2~165 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=caef4c77769e0825ca424c0f773cbd3d690f3766;p=php Handle numeric keys passed via GPC --- diff --git a/main/main.c b/main/main.c index 1be845c08e..211c1c326e 100644 --- a/main/main.c +++ b/main/main.c @@ -1588,12 +1588,14 @@ static zend_bool php_auto_globals_create_request(TSRMLS_D) zval **data; char *string_key; uint string_key_len; + ulong num_key; zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(form_variables), &pos); while (zend_hash_get_current_data_ex(Z_ARRVAL_P(form_variables), (void **)&data, &pos) == SUCCESS) { - zend_hash_get_current_key_ex(Z_ARRVAL_P(form_variables), &string_key, &string_key_len, NULL, 0, &pos); - - ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), string_key, string_key_len, *data, (*data)->refcount+1, 0); + /* we only register string keys, since we cannot have $1234 */ + if (zend_hash_get_current_key_ex(Z_ARRVAL_P(form_variables), &string_key, &string_key_len, &num_key, 0, &pos) == HASH_KEY_IS_STRING) { + ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), string_key, string_key_len, *data, (*data)->refcount+1, 0); + } zend_hash_move_forward_ex(Z_ARRVAL_P(form_variables), &pos); } }