diff options
author | Dmitry Stogov <dmitry@php.net> | 2005-05-25 17:41:18 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2005-05-25 17:41:18 +0000 |
commit | 00448a52113fa7ff33dbe8731e8f152e8c43631c (patch) | |
tree | 0a0f8a1b94748dd82636ce138785da6e9acf12dd /main/php_variables.c | |
parent | 2640b806d6d1f92acebb311ff3518670c58df6b0 (diff) | |
download | php-git-00448a52113fa7ff33dbe8731e8f152e8c43631c.tar.gz |
Fixed bug #29971 (variables_order behaviour)
Diffstat (limited to 'main/php_variables.c')
-rw-r--r-- | main/php_variables.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/main/php_variables.c b/main/php_variables.c index a3f913cc2c..1e0180458c 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -707,7 +707,15 @@ int php_hash_environment(TSRMLS_D) static zend_bool php_auto_globals_create_server(char *name, uint name_len TSRMLS_DC) { - php_register_server_variables(TSRMLS_C); + if (strchr(PG(variables_order),'S') || strchr(PG(variables_order),'s')) { + php_register_server_variables(TSRMLS_C); + } else { + zval *server_vars=NULL; + ALLOC_ZVAL(server_vars); + array_init(server_vars); + INIT_PZVAL(server_vars); + PG(http_globals)[TRACK_VARS_SERVER] = server_vars; + } zend_hash_update(&EG(symbol_table), name, name_len+1, &PG(http_globals)[TRACK_VARS_SERVER], sizeof(zval *), NULL); PG(http_globals)[TRACK_VARS_SERVER]->refcount++; @@ -729,7 +737,9 @@ static zend_bool php_auto_globals_create_env(char *name, uint name_len TSRMLS_DC INIT_PZVAL(env_vars); PG(http_globals)[TRACK_VARS_ENV] = env_vars; - php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC); + if (strchr(PG(variables_order),'E') || strchr(PG(variables_order),'e')) { + php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC); + } zend_hash_update(&EG(symbol_table), name, name_len+1, &PG(http_globals)[TRACK_VARS_ENV], sizeof(zval *), NULL); PG(http_globals)[TRACK_VARS_ENV]->refcount++; |