Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Dotenv] Get env using $_SERVER to work with fastcgi_param and workaround thread safety issues#23949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ound thread safety issues
| putenv("$name=$value"); | ||
| $_ENV[$name] =$value; | ||
| $_SERVER[$name] =$value; | ||
| if ($notHttpName) { |
nicolas-grekasAug 22, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
with this, env vars that start withHTTP_* do not populate$_SERVER anymore.
this is to mitigate security issues with$_SERVER mixing several sources (env+http headers+etc).
fabpot commentedAug 22, 2017
Thank you@nicolas-grekas. |
… and workaround thread safety issues (nicolas-grekas)This PR was merged into the 3.3 branch.Discussion----------[Dotenv] Get env using $_SERVER to work with fastcgi_param and workaround thread safety issues| Q | A| ------------- | ---| Branch? | 3.3| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#23502| License | MIT| Doc PR | -`getenv()` is not thread safe, and doesn't work with `fastcgi_param`, see links in linked issue.Commits-------f76e420 [Dotenv] Get env using $_SERVER to work with fastcgi_param and workaround thread safety issues
getenv()is not thread safe, and doesn't work withfastcgi_param, see links in linked issue.