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] PHP notice on invalid input #35344

Closed
ntzm opened this issue Jan 14, 2020 · 2 comments
Closed

[Yaml] PHP notice on invalid input #35344

ntzm opened this issue Jan 14, 2020 · 2 comments

Comments

@ntzm
Copy link

ntzm commented Jan 14, 2020

Symfony version(s) affected: 5.0.2

Description

When trying to parse an invalid YAML string of "!", a PHP notice is emitted

How to reproduce

\Symfony\Component\Yaml\Yaml::parse('!');

Additional context

PHP Notice:  Uninitialized string offset: 1 in /home/nat/Code/personal/fuzzer-test/yaml/vendor/symfony/yaml/Inline.php on line 79

Notice: Uninitialized string offset: 1 in /home/nat/Code/personal/fuzzer-test/yaml/vendor/symfony/yaml/Inline.php on line 79
PHP Notice:  Uninitialized string offset: 1 in /home/nat/Code/personal/fuzzer-test/yaml/vendor/symfony/yaml/Inline.php on line 272

Notice: Uninitialized string offset: 1 in /home/nat/Code/personal/fuzzer-test/yaml/vendor/symfony/yaml/Inline.php on line 272
@fancyweb
Copy link
Contributor

That behavior was deprecated in 3.4: Using the unquoted scalar value "!" is deprecated since Symfony 3.3 and will be considered as a tagged value in 4.0. You must quote it on line 1.. It should throw a better message. But once again, like #35344, since it's just a notice currently, I don't know if we can throw.

@xabbuh
Copy link
Member

xabbuh commented Jan 15, 2020

That's a bug to me. A proper ParseException should be thrown instead.

nicolas-grekas added a commit that referenced this issue Jan 21, 2020
This PR was merged into the 4.3 branch.

Discussion
----------

[Yaml] Throw on unquoted exclamation mark

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? |
| Tickets       | #35344
| License       | MIT
| Doc PR        | -

Commits
-------

6b4147c [Yaml] Throw on unquoted exclamation mark
symfony-splitter pushed a commit to symfony/yaml that referenced this issue Jan 21, 2020
This PR was merged into the 4.3 branch.

Discussion
----------

[Yaml] Throw on unquoted exclamation mark

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? |
| Tickets       | symfony/symfony#35344
| License       | MIT
| Doc PR        | -

Commits
-------

6b4147c991 [Yaml] Throw on unquoted exclamation mark
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

5 participants