Skip to content

Conversation

bukka
Copy link
Member

@bukka bukka commented Jan 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant