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] Non ASCII characters disappearing during the escapeshellarg#21485

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

Closed
GuillaumeVerdon wants to merge8 commits intosymfony:3.2fromGuillaumeVerdon:escapeargumentfix
Closed

[Process] Non ASCII characters disappearing during the escapeshellarg#21485

GuillaumeVerdon wants to merge8 commits intosymfony:3.2fromGuillaumeVerdon:escapeargumentfix

Conversation

@GuillaumeVerdon
Copy link
Contributor

@GuillaumeVerdonGuillaumeVerdon commentedFeb 1, 2017
edited by nicolas-grekas
Loading

If the LC_CTYPE is not set at UTF-8, the escapeshellarg() function will remove every non-ascii characters.

As it's usual in europe to have directories with non-ascii chars in their name (ex : ~/Vidéos) the function should throw an exception if we're trying to submit it an argument containing non-ascii param and the LC_CTYPE is not set to use UTF-8

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

I had this issue while using the lib ffmpeg and giving it a path like "~/Vidéos" the "é" chars was disappearing from the command giving a RuntimeException.

The problem was my LC_CTYPE that wasn't set properly, I believe an exception should be raised before the RuntimeException to warn the user of that behavior

If the LC_CTYPE is not set at UTF-8, the escapeshellarg() function will remove every non-ascii characters.As it's usual in europe to have directories with non-ascii chars in their name (ex : ~/Vidéos) the function should throw an exception if we're trying to submit it an argument containing non-ascii param and the LC_CTYPE is not set to use UTF-8
@stofstof changed the base branch from2.3 to3.2February 1, 2017 09:44
@GuillaumeVerdonGuillaumeVerdon changed the titleEscapeargumentfix[Process] Non ASCII characters disappearing during the escapeshellargFeb 1, 2017
@nicolas-grekas
Copy link
Member

nicolas-grekas commentedFeb 1, 2017
edited
Loading

what about doing escaping ourselves instead?
return "'".str_replace(array('\\', "'"), array('\\\\', "\\'"), $argument)."'";
can you try it? does it work?
if yes, can you pelase update your PR and add a test case?

@GuillaumeVerdon
Copy link
ContributorAuthor

GuillaumeVerdon commentedFeb 1, 2017
edited
Loading

I edited the current test case and the logic for Linux, as I don't know how the function is working on windows I didn't patch it.

ProcessUtilsTest.php is passing on my environment

@nicolas-grekas
Copy link
Member

👍 (to be merged on 2.7, Windows is unaffected)

@nicolas-grekasnicolas-grekas added this to the2.7 milestoneFeb 1, 2017
@nicolas-grekas
Copy link
Member

Thank you@GuillaumeVerdon.

nicolas-grekas added a commit that referenced this pull requestFeb 2, 2017
…apeshellarg (GuillaumeVerdon)This PR was submitted for the 3.2 branch but it was merged into the 2.7 branch instead (closes#21485).Discussion----------[Process] Non ASCII characters disappearing during the escapeshellargIf the LC_CTYPE is not set at UTF-8, the escapeshellarg() function will remove every non-ascii characters.As it's usual in europe to have directories with non-ascii chars in their name (ex : ~/Vidéos) the function should throw an exception if we're trying to submit it an argument containing non-ascii param and the LC_CTYPE is not set to use UTF-8| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   || Fixed tickets || License       | MIT| Doc PR        |I had this issue while using the lib ffmpeg and giving it a path like "~/Vidéos" the "é" chars was disappearing from the command giving a RuntimeException.The problem was my LC_CTYPE that wasn't set properly, I believe an exception should be raised before the RuntimeException to warn the user of that behaviorCommits-------3779f3f [Process] Non ASCII characters disappearing during the escapeshellarg
@GuillaumeVerdonGuillaumeVerdon deleted the escapeargumentfix branchFebruary 2, 2017 14:01
This was referencedFeb 6, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

2.7

Development

Successfully merging this pull request may close these issues.

3 participants

@GuillaumeVerdon@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp