8000 [YAML] Bogus { } is not treated as an error · Issue #30298 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[YAML] Bogus { } is not treated as an error #30298

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

Closed
kiler129 opened this issue Feb 18, 2019 · 1 comment
Closed

[YAML] Bogus { } is not treated as an error #30298

kiler129 opened this issue Feb 18, 2019 · 1 comment

Comments

@kiler129
Copy link
Contributor

Symfony version(s) affected: 4.2.3

Description
Given the following YAML:

access_control:
    - test: abc,
      ips:
        - 127.0.0.1
        - ::1
    - {
        test: abc
        ips:
          - 127.0.0.1
          - ::1
      }
    - {
        test: abc
        ips:
            - 127.0.0.1
            - ::1
      }

The output should be an error, while instead the code is parsed info

How to reproduce

dd(Yaml::parse("access_control:
    - test: abc,
      ips:
        - 127.0.0.1
        - ::1
    - {
        test: abc
        ips:
          - 127.0.0.1
          - ::1
      }
    - {
        test: abc
        ips:
            - 127.0.0.1
            - ::1
      }
"));

Possible Solution
I'm not confident to dig into the YAML component parser ;)

Additional context
The actual output looks like the following:

image

This combined with the fact security component doesn't validate IPs caused a small headache ;)

@xabbuh
Copy link
Member
xabbuh commented Feb 19, 2019

While you are right that the parser currently is not able to parse structures like these I am still closing here as this is about the same cause (inline notation spanning multiple lines) as #25239. Thank you for understanding.

67A9

@xabbuh xabbuh closed this as completed Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0