Skip to content
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

[YAML] properly mask escape sequences in quoted strings #11850

Merged
merged 1 commit into from Sep 5, 2014

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Sep 4, 2014

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #11789
License MIT
Doc PR

@stof
Copy link
Member

stof commented Sep 4, 2014

shoudn't this be handled by the escaping of backslahes already ? It is actually a matter of a backslash followed by another char

@stof
Copy link
Member

stof commented Sep 4, 2014

hmm, actually, we are only escaping doubled backslahes, which is wrong IMO. we should escape all backslashes to be safe

Btw, your own list is incomplete. There is more escaped chars in YAML: http://www.yaml.org/spec/1.2/spec.html#id2776092

@xabbuh
Copy link
Member Author

xabbuh commented Sep 4, 2014

You're right. I tried escaping first which didn't work. But I guess that was simply a matter of where they have been placed.

@stof
Copy link
Member

stof commented Sep 4, 2014

I think it is a matter of replacing the first element to escape single backslahes

@xabbuh
Copy link
Member Author

xabbuh commented Sep 4, 2014

I modified the escaper. This should now work as expected.

@xabbuh
Copy link
Member Author

xabbuh commented Sep 4, 2014

And I added some more tests (mainly to ensure that constructs like \t\\ or \t\\\\ don't break).

@fabpot fabpot added the Yaml label Sep 5, 2014
@fabpot
Copy link
Member

fabpot commented Sep 5, 2014

👍

1 similar comment
@stof
Copy link
Member

stof commented Sep 5, 2014

👍

@fabpot
Copy link
Member

fabpot commented Sep 5, 2014

Thank you @xabbuh.

@fabpot fabpot merged commit a7d0cf2 into symfony:2.3 Sep 5, 2014
fabpot added a commit that referenced this pull request Sep 5, 2014
…abbuh)

This PR was merged into the 2.3 branch.

Discussion
----------

[YAML] properly mask escape sequences in quoted strings

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11789
| License       | MIT
| Doc PR        |

Commits
-------

a7d0cf2 properly mask escape sequences in quoted strings
@xabbuh xabbuh deleted the issue-11789 branch September 5, 2014 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants