-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Console\Input\StringInput doesn't handle escaped single quotes correctly #32182
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That's not StringInput's job: the shell should have already parsed the string so that PHP/StringInput should be given the already resolved string. What you describe is not what StringInput::tokenize() is for. |
That's not what StringInputTest suggests?
|
I've got a similar issue without using |
Hey, thanks for your report! |
Yes, still relevant. |
Hey, thanks for your report! |
Yes, still relevant, stop trying to avoid issues. |
@bohwaz are you up to fixing the issue? |
…s-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [Console] fix parsing escaped chars in StringInput | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #32182 | License | MIT | Doc PR | - Commits ------- f0a89ec [Console] fix parsing escaped chars in StringInput
Symfony version(s) affected: 2.8-4.3
Description
Symfony\Component\Console\Input\StringInput doesn't work with arguments escaped by
escapeshellarg
.escapeshellarg
on a string with single quotes will produce a closing single quote, an escaped single quote and an opening single quote:This is correct as per bash documentation: https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Single-Quotes
But this breaks StringInput as it breaks up the string in multiple tokens.
How to reproduce
Output:
Possible Solution
StringInput should handle escaped characters outside of single quotes part of the string.
The text was updated successfully, but these errors were encountered: