Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround PHP bug with env vars not being read correctly on Windows, f…
…ixes #10434 refs php/php-src#7896
- Loading branch information
Showing
1 changed file
with
6 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,12 @@ if (function_exists('ini_set')) { | |
unset($memoryLimit); | ||
} | ||
|
||
// Workaround PHP bug on Windows where env vars containing Unicode chars are mangled in $_SERVER | ||
// see https://github.com/php/php-src/issues/7896 | ||
if (Platform::isWindows()) { | ||
$_SERVER = array_merge($_SERVER, array_intersect_ukey($_SERVER, getenv(), 'strcasecmp')); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Seldaek
Author
Member
|
||
} | ||
|
||
Platform::putEnv('COMPOSER_BINARY', realpath($_SERVER['argv'][0])); | ||
|
||
ErrorHandler::register(); | ||
|
getenv()
without a param is PHP 7.1 and this is on the 2.2 branch which allows lower versions ?