[php-src] Issue #7896: Env vars with non-ASCII values are mangled when read from $_SERVER on Windows
| From: | Seldaek | Date: | Thu, 06 Jan 2022 13:55:23 +0000 |
| Subject: | [php-src] Issue #7896: Env vars with non-ASCII values are mangled when read from $_SERVER on Windows | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-238819@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7896
Comment Author: Seldaek
Thanks, do you see any way to mitigate/detect this in userland?
I see that doing this when starting up to ensure
$_SERVER is in a good state appears to
work.. not sure if there's a better way:
```
foreach ($_SERVER as $var => $val) {
if (($val = getenv($var)) !== false) {
$_SERVER[$var] = $val;
}
}
```
Once fixed in a release I'll at least be able to exclude this hackery from newer PHP versions.