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 escaping arguments on Windows when inheritEnvironmentVariables is set to false#22614

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
nicolas-grekas merged 1 commit intosymfony:3.3frommaryo:process_failing_test
May 22, 2017

Conversation

@maryo
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?no
Fixed tickets
LicenseMIT
Doc PR

I've added a FAILING testcase on Windows. It incorrectly substitutes an argument containing a quotation mark probably assuming it's an env var needed to backup when inheritEnvironmentVariables is set to false.

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedMay 2, 2017
edited
Loading

CallinginheritEnvironmentVariables(false) is deprecated, which means you're mixing new features and deprecated ones. This should be avoided and is barely supported. Still, would you be able to provide a patch for this issue?

@nicolas-grekasnicolas-grekas added this to the3.3 milestoneMay 4, 2017
@maryomaryo changed the title[Process] Added testcase failing on Windows when inheritEnvironmentVariables is set to false[Process] Fixed escaping arguments on Windows when inheritEnvironmentVariables is set to falseMay 7, 2017
@maryo
Copy link
ContributorAuthor

maryo commentedMay 7, 2017
edited
Loading

OK. I actually don't use this functionality :-). I just noticed it was not working when I was debugging the failing tests and considered it a BC break. I've updated the PR to fix this.

$var =$uid.++$varCount;
putenv("$var=\"$value\"");

if ($env ===null) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

yoda style: null === $env

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

updated

if ($env ===null) {
putenv("$var=$value");
}else {
$env[$var] =$value;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Because of line 1656 above, $value will be quoted. It shouldn't, isn't it?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@nicolas-grekas
I thought the same at the beginning but the argument needs to be escaped even it's passed using the!var! notation (and stored inside the env vars). The tests don't pass without the quotes. BTW I am not exactly sure why it's done using the!var! workarround. Looks like a clever trick and perhaps you are it's author (due to github history/annotations). Is it somehow related to how inconsistently Windows commands handle unescaping of double quotes? (Should be mostly triple quotes and i've found an article describing it but it's not exactly specified so some commands handle it differently). I'm just curious :-)

@xabbuhxabbuh changed the base branch frommaster to3.3May 22, 2017 07:18
@xabbuh
Copy link
Member

@maryo Can you rebase here? I have fixed the base branch given that master now is for Symfony 4.0, but the PR now contains unrelated commits.

@nicolas-grekas
Copy link
Member

pleaserebase on 3.3 (there should be no merge commit it the PR history)

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.

👍 (understood & rebased)

@nicolas-grekas
Copy link
Member

Thank you@maryo.

@nicolas-grekasnicolas-grekas merged commit26032ef intosymfony:3.3May 22, 2017
nicolas-grekas added a commit that referenced this pull requestMay 22, 2017
…EnvironmentVariables is set to false (maryo)This PR was merged into the 3.3 branch.Discussion----------[Process]  Fixed escaping arguments on Windows when inheritEnvironmentVariables is set to false| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | no| Fixed tickets || License       | MIT| Doc PR        |I've added a FAILING testcase on Windows. It incorrectly substitutes an argument containing a quotation mark probably assuming it's an env var needed to backup when inheritEnvironmentVariables is set to false.Commits-------26032ef [Process] Fixed incorrectly escaping arguments on Windows when inheritEnvironmentVariables is set to false
@fabpotfabpot mentioned this pull requestMay 29, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

4 participants

@maryo@nicolas-grekas@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp