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] fixed uppercase ARGC and ARGV should also be skipped#44538
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
carsonbot commentedDec 10, 2021
Hey! I think@andrei0x309 has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
nicolas-grekas left a comment
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.
Can you figure out where this uppercase ARGV comes from in your case? It looks like a buggy code. Yes, we were allowing it before, but this was not legit to me.
| $envPairs = []; | ||
| foreach ($envas$k =>$v) { | ||
| if (false !==$v &&'argc' !==$k &&'argv' !==$k) { | ||
| if (false !==$v &&false ===\in_array(strtolower($k), ['argc','argv'],true)) { |
nicolas-grekasDec 11, 2021 • 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.
I'd prefer not calling strtolower for that. Let's use this instead if you don't mind:if (false !== $v && false === \in_array($k, ['argc', 'argv', 'ARGC', 'ARGV'], true)) {
fabpot commentedDec 11, 2021
Thank you@rbaarsma. |
rbaarsma commentedDec 12, 2021 • 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.
@nicolas-grekas I haven't fully debugged how, but it was coming from liuggio/fastest, which executes unit tests in parallel processes. I can dive in deeper that maybe they are doing it wrong and shouldn't do it, but still that should not break Symfony I guess ;) Also see the related issue on how to reproduce |
uppercase env ARGC and ARGV were showing a warning:
This PR fixes that by adding upon the existing functionality blocking argv and argc env vars to become part of the eventual env vars.