summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/main.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/main/main.c b/main/main.c
index 511e6db494..5f17378937 100644
--- a/main/main.c
+++ b/main/main.c
@@ -947,6 +947,8 @@ static int php_hash_environment(ELS_D SLS_DC PLS_DC)
unsigned char _gpc_flags[3] = {0,0,0};
zend_bool have_variables_order;
+ PG(http_globals).post = PG(http_globals).get = PG(http_globals).cookie = PG(http_globals).server = PG(http_globals).environment = PG(http_globals).post_files = NULL;
+
if (PG(variables_order)) {
p = PG(variables_order);
have_variables_order=1;
@@ -956,8 +958,6 @@ static int php_hash_environment(ELS_D SLS_DC PLS_DC)
php_import_environment_variables(ELS_C PLS_CC);
}
- PG(http_globals).post = PG(http_globals).get = PG(http_globals).cookie = PG(http_globals).server = PG(http_globals).environment = PG(http_globals).post_files = NULL;
-
while(*p) {
switch(*p++) {
case 'p':
@@ -991,13 +991,15 @@ static int php_hash_environment(ELS_D SLS_DC PLS_DC)
break;
case 's':
case 'S':
- if (sapi_module.register_server_variables) {
- php_register_server_variables(ELS_C SLS_CC PLS_CC);
- }
+ php_register_server_variables(ELS_C SLS_CC PLS_CC);
break;
}
}
+ if (!have_variables_order) {
+ php_register_server_variables(ELS_C SLS_CC PLS_CC);
+ }
+
if (PG(http_globals).post) {
zend_hash_add_ptr(&EG(symbol_table), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), PG(http_globals).post, sizeof(zval *), NULL);
}
@@ -1017,10 +1019,6 @@ static int php_hash_environment(ELS_D SLS_DC PLS_DC)
zend_hash_add_ptr(&EG(symbol_table), "HTTP_POST_FILES", sizeof("HTTP_POST_FILES"), PG(http_globals).post_files, sizeof(zval *),NULL);
}
- if (!have_variables_order) {
- php_register_server_variables(ELS_C SLS_CC PLS_CC);
- }
-
return SUCCESS;
}