mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
- Fix precedence of the variables order in $_FORM
- Rename $_FORM to $_REQUEST for now
This commit is contained in:
parent
9d11db1200
commit
6fdf6b4c82
2
NEWS
2
NEWS
@ -1,7 +1,7 @@
|
||||
PHP 4.0 NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 200?, Version 4.0.7-dev
|
||||
- Introduced a new $_FORM variable, which includes any GET, POST or COOKIE
|
||||
- Introduced a new $_REQUEST array, which includes any GET, POST or COOKIE
|
||||
variables. Like the other new variables, this variable is also available
|
||||
regardless of the context. (Andi & Zeev)
|
||||
- Introduced $_GET, $_POST, $_COOKIE, $_SERVER and $_ENV variables, which
|
||||
|
11
main/main.c
11
main/main.c
@ -894,7 +894,7 @@ int php_module_startup(sapi_module_struct *sf)
|
||||
for (i=0; i<6; i++) {
|
||||
zend_register_auto_global(short_track_vars_names[i], short_track_vars_names_length[i]-1 TSRMLS_CC);
|
||||
}
|
||||
zend_register_auto_global("_FORM", sizeof("_FORM")-1 TSRMLS_CC);
|
||||
zend_register_auto_global("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC);
|
||||
zend_set_utility_values(&zuv);
|
||||
php_startup_sapi_content_types();
|
||||
|
||||
@ -1146,20 +1146,21 @@ static int php_hash_environment(TSRMLS_D)
|
||||
switch (*p) {
|
||||
case 'g':
|
||||
case 'G':
|
||||
zend_hash_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]), (void (*)(void *pData)) zval_add_ref, NULL, sizeof(zval *), 0);
|
||||
zend_hash_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]), (void (*)(void *pData)) zval_add_ref, NULL, sizeof(zval *), 1);
|
||||
zend_hash_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_FILES]), (void (*)(void *pData)) zval_add_ref, NULL, sizeof(zval *), 1);
|
||||
break;
|
||||
case 'p':
|
||||
case 'P':
|
||||
zend_hash_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]), (void (*)(void *pData)) zval_add_ref, NULL, sizeof(zval *), 0);
|
||||
zend_hash_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]), (void (*)(void *pData)) zval_add_ref, NULL, sizeof(zval *), 1);
|
||||
break;
|
||||
case 'c':
|
||||
case 'C':
|
||||
zend_hash_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]), (void (*)(void *pData)) zval_add_ref, NULL, sizeof(zval *), 0);
|
||||
zend_hash_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]), (void (*)(void *pData)) zval_add_ref, NULL, sizeof(zval *), 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
zend_hash_update(&EG(symbol_table), "_FORM", sizeof("_FORM"), &form_variables, sizeof(zval *), NULL);
|
||||
zend_hash_update(&EG(symbol_table), "_REQUEST", sizeof("_REQUEST"), &form_variables, sizeof(zval *), NULL);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
|
Loading…
Reference in New Issue
Block a user