[php-src] PR #13195: Fix bug #75712: getenv in php-fpm should not read $_ENV, $_SERVER
| From: | bukka | Date: | Fri, 19 Jan 2024 15:04:17 +0000 |
| Subject: | [php-src] PR #13195: Fix bug #75712: getenv in php-fpm should not read $_ENV, $_SERVER | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-24832@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/13195
Author: bukka
Currently
getenv() returned array contains different environment variables compare to
environment variable search by single varaible return call (passing string argument like
getenv($env_name)). The bigger problem is that the array does not even have to contain
only string values. In case of the reported issue it copied argv array into it.
The reason for the above misbehaviour is that it uses logic used for $_ENV filling
which does different thing in PHP-FPM (even though some of the logic is also questionable and should
be changed) due to some historic reasons most likely. It also applies variable filtering which is
not used for single value return.
The PR fixes the issue by introducing a different function for loading env vars which defaults to
calling old import function. This is overwritten in FPM and different logic (matching single env
return) is used.