Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Process] Skip environment variables with false value in Process#25869
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
| $envPairs =array(); | ||
| foreach ($envas$k =>$v) { | ||
| $envPairs[] =$k.'='.$v; | ||
| if (is_string($v)) { |
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.
Should be more specific IMHO. Eg numbers should not be filtered. false !== ?
francoispluchinoJan 21, 2018 • 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.
Initially, this is the test I did to fix the problem, but after, I saw the test in thegetDefaultEnv() method. I also prefer to usefalse !== because it is more specific. I change that immediately.
francoispluchino commentedJan 21, 2018
@nicolas-grekas It's updated. |
nicolas-grekas commentedJan 21, 2018
Thank you@francoispluchino. |
…rocess (francoispluchino)This PR was merged into the 3.3 branch.Discussion----------[Process] Skip environment variables with false value in Process| Q | A| ------------- | ---| Branch? | master, 4.0, 3.3, 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | ~| License | MIT| Doc PR | ~With the commit03adce2, all env variables are injecting in the process, and the env variable with the `false` value are converted in empty string.For example, it's problematic with the bundle SymfonyWebServerBundle and the last version of the [symfony/framework-bundle recipe](https://github.com/symfony/recipes/blob/master/symfony/framework-bundle/3.3/public/index.php#L11), because the WebServer override the value of `APP_ENV` with `false` to override previously loaded variables (c5a1218), and with the commit03adce2, the `APP_ENV` variable is injected with a empty string value, instead of not being injected, as was the case before.This PR not use the same logic as the [getDefaultEnv()](https://github.com/symfony/symfony/blob/4.0/src/Symfony/Component/Process/Process.php#L1553) method.Commits-------2daf4f9 [Process] Skip environment variables with false value in Process
francoispluchino commentedJan 21, 2018
@nicolas-grekas It's always a pleasure to help. |
Uh oh!
There was an error while loading.Please reload this page.
With the commit03adce2, all env variables are injecting in the process, and the env variable with the
falsevalue are converted in empty string.For example, it's problematic with the bundle SymfonyWebServerBundle and the last version of thesymfony/framework-bundle recipe, because the WebServer override the value of
APP_ENVwithfalseto override previously loaded variables (c5a1218), and with the commit03adce2, theAPP_ENVvariable is injected with a empty string value, instead of not being injected, as was the case before.This PR not use the same logic as thegetDefaultEnv() method.