diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 723a6cd31d27a..b5f7a1f050233 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -663,17 +663,11 @@ static void cgi_php_load_env_var(const char *var, unsigned int var_len, char *va static void cgi_php_import_environment_variables(zval *array_ptr) { - if (PG(variables_order) && (strchr(PG(variables_order),'E') || strchr(PG(variables_order),'e'))) { - if (Z_TYPE(PG(http_globals)[TRACK_VARS_ENV]) != IS_ARRAY) { - zend_is_auto_global(ZSTR_KNOWN(ZEND_STR_AUTOGLOBAL_ENV)); - } - - if (Z_TYPE(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY && - Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_ENV])) { - zend_array_destroy(Z_ARR_P(array_ptr)); - Z_ARR_P(array_ptr) = zend_array_dup(Z_ARR(PG(http_globals)[TRACK_VARS_ENV])); - return; - } + if (Z_TYPE(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY && + Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_ENV])) { + zend_array_destroy(Z_ARR_P(array_ptr)); + Z_ARR_P(array_ptr) = zend_array_dup(Z_ARR(PG(http_globals)[TRACK_VARS_ENV])); + return; } /* call php's original import as a catch-all */ diff --git a/sapi/cgi/tests/auto_globals_no_jit.phpt b/sapi/cgi/tests/auto_globals_no_jit.phpt new file mode 100644 index 0000000000000..e331709db6db8 --- /dev/null +++ b/sapi/cgi/tests/auto_globals_no_jit.phpt @@ -0,0 +1,17 @@ +--TEST-- +CGI with auto_globals_jit=0 +--INI-- +auto_globals_jit=0 +--CGI-- +--ENV-- +FOO=BAR +--FILE-- + +--EXPECT-- +string(3) "BAR" +string(3) "BAR" +string(3) "BAR"

AltStyle によって変換されたページ (->オリジナル) /