When bug 77574[1] has been fixed, the fix only catered to variables retrieved via `getenv()` with a `$varname` passed, but neither to `getenv()` without arguments nor to the general import of environment variables into `$_ENV` and `$_SERVER`. We catch up on this by using `GetEnvironmentStringsW()` in `_php_import_environment_variables()` and converting the encoding to whatever had been chosen by the user. [1] <https://bugs.php.net/bug.php?id=75574> Closes GH-7928.
21 lines
351 B
PHP
21 lines
351 B
PHP
--TEST--
|
|
GH-7896 (Environment vars may be mangled on Windows)
|
|
--SKIPIF--
|
|
<?php
|
|
if (PHP_OS_FAMILY !== "Windows") die("skip for Windows only");
|
|
?>
|
|
--ENV--
|
|
FÖÖ=GüИter传
|
|
--FILE--
|
|
<?php
|
|
var_dump(
|
|
$_SERVER['FÖÖ'],
|
|
$_ENV['FÖÖ'],
|
|
getenv('FÖÖ')
|
|
);
|
|
?>
|
|
--EXPECT--
|
|
string(11) "GüИter传"
|
|
string(11) "GüИter传"
|
|
string(11) "GüИter传"
|