8000 [Console] Input::__toString escaping fixes by Seldaek · Pull Request #7657 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] Input::__toString escaping fixes #7657

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

Merged
merged 2 commits into from
Apr 12, 2013

Conversation

Seldaek
Copy link
Member
@Seldaek Seldaek commented Apr 12, 2013

Follow up to #7648, also includes a fix for StringInput to parse newlines and other whitespace chars properly instead of normalizing them all to spaces. It was kinda needed to test it properly, so I bundled both in one.

@Seldaek
Copy link
Member Author
Seldaek commented Apr 12, 2013

/cc @igorw

if (false !== strpos($token, ' ')) {
return '"'.$token.'"';
if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) {
return $match[1] . (preg_match('{^[\w-]+$}', $match[2]) ? $match[2] : escapeshellarg($match[2]));
Copy link
Contributor

Choose a reason for hiding this comment

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

Extract method for escapeToken?

@igorw
Copy link
Contributor
igorw commented Apr 12, 2013

👍

fabpot added a commit that referenced this pull request Apr 12, 2013
This PR was merged into the master branch.

Discussion
----------

[Console] Input::__toString escaping fixes

Follow up to #7648, also includes a fix for StringInput to parse newlines and other whitespace chars properly instead of normalizing them all to spaces. It was kinda needed to test it properly, so I bundled both in one.

Commits
-------

93b1369 [Console] Fix StringInput parsing to accept newlines and tabs
8642b67 [Console] Fix escaping of args
@fabpot fabpot merged commit 93b1369 into symfony:master Apr 12, 2013
stof added a commit to stof/symfony that referenced this pull request Apr 13, 2013
The PR symfony#7657 introduced a requirement on PHP 5.4 by mistake.
fabpot added a commit that referenced this pull request Apr 13, 2013
This PR was merged into the master branch.

Discussion
----------

Fixed the Console code on PHP 5.3

| Q             | A
| ------------- | ---
| Fixed tickets | none (catched by the Travis builds)
| License       | MIT

The PR #7657 introduced a requirement on PHP 5.4 by mistake.

Commits
-------

1356050 Fixed the Console code on PHP 5.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0