Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
fabpot merged 1 commit intosymfony:4.4fromrbaarsma:issue-44534
Dec 11, 2021

Conversation

@rbaarsma
Copy link
Contributor

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#44534
LicenseMIT
Doc PRno

uppercase env ARGC and ARGV were showing a warning:

[09-Dec-2021 17:17:05 Europe/Amsterdam] PHP Warning:  Array to string conversion in /var/www/app/vendor/symfony/process/Process.php on line 344

This PR fixes that by adding upon the existing functionality blocking argv and argc env vars to become part of the eventual env vars.

@carsonbot
Copy link

Hey!

I think@andrei0x309 has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

Copy link
Member

@nicolas-grekasnicolas-grekas left a 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)) {
Copy link
Member

@nicolas-grekasnicolas-grekasDec 11, 2021
edited
Loading

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
Copy link
Member

Thank you@rbaarsma.

rbaarsma reacted with thumbs up emoji

@fabpotfabpot merged commitac3631a intosymfony:4.4Dec 11, 2021
@rbaarsma
Copy link
ContributorAuthor

rbaarsma commentedDec 12, 2021
edited
Loading

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.

@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

@rbaarsmarbaarsma deleted the issue-44534 branchDecember 14, 2021 16:05
This was referencedDec 29, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@fabpotfabpotfabpot approved these changes

@chalasrchalasrAwaiting requested review from chalasr

@dunglasdunglasAwaiting requested review from dunglas

@lyrixxlyrixxAwaiting requested review from lyrixx

@wouterjwouterjAwaiting requested review from wouterj

@xabbuhxabbuhAwaiting requested review from xabbuh

@ycerutoycerutoAwaiting requested review from yceruto

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

4 participants

@rbaarsma@carsonbot@fabpot@nicolas-grekas

[8]ページ先頭

©2009-2025 Movatter.jp