-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
YAML does not escape hyphens when used in sequences #9039
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
This was referenced Oct 10, 2013
There is actually 2 bugs here:
|
stof
added a commit
to stof/symfony
that referenced
this issue
Oct 10, 2013
Dashes need to be escaped in character sets in regexes as they are used to specify a range otherwise. Refs symfony#9039
fabpot
added a commit
that referenced
this issue
Oct 11, 2013
…hen dumping (stof) This PR was merged into the 2.2 branch. Discussion ---------- [Yaml] Fixed the escaping of strings starting with a dash when dumping Dashes need to be escaped in character sets in regexes as they are used to specify a range otherwise. It fixes the dumper bug reported in #9039 (the parsing issue is not fix here) | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | partially #9039 | License | MIT | Doc PR | n/a Commits ------- af369ae [Yaml] Fixed the escaping of strings starting with a dash when dumping
This is fixed now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was comparing Symfony's compatibility with Spyc and found an issue with Symfony's YAML encoder.
The issue arose when encoding an array like this:
Symfony produces a YAML file like this:
The hyphen is not quoted, but it should be. Other "Indicators" from the YAML standard seem to be encoded, like the pipe character in this example. Without quoting, when Spyc tries to read this YAML file, it considers the hyphen to be an empty entry, like this:
The matching issue at Spyc is here: mustangostang/spyc#26, but I think this is an issue with Symfony's encoder, considering it's the one generating incorrect YAML.
The text was updated successfully, but these errors were encountered: