This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Yaml
Fabien Potencier ab1d9383b9 bug #21523 #20411 fix Yaml parsing for very long quoted strings (RichardBradley)
This PR was squashed before being merged into the 2.7 branch (closes #21523).

Discussion
----------

#20411 fix Yaml parsing for very long quoted strings

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

This is a second fix for the issue discussed in #20411. My first PR (#21279) didn't fix the bug in all cases, sorry.

If a YAML string has too many spaces in the value, it can trigger a `PREG_BACKTRACK_LIMIT_ERROR` error in the Yaml parser.

There should be no behavioural change other than the bug fix

I have included a test which fails before this fix and passes after this fix.

I have also added checks that detect other PCRE internal errors and throw a more descriptive exception. Before this patch, the YAML engine would often give incorrect results, rather than throwing, on a PCRE `PREG_BACKTRACK_LIMIT_ERROR` error.

Commits
-------

c9a1c09182 #20411 fix Yaml parsing for very long quoted strings
2017-03-17 09:20:26 -07:00
..
Exception remove api tags from code 2015-09-28 19:11:22 +02:00
Tests bug #21523 #20411 fix Yaml parsing for very long quoted strings (RichardBradley) 2017-03-17 09:20:26 -07:00
.gitignore Added missing files .gitignore 2013-07-21 14:12:18 +02:00
CHANGELOG.md [Yaml] added CHANGELOG 2012-04-26 19:44:03 +02:00
composer.json Merge branch '2.3' into 2.7 2015-10-30 13:10:21 -07:00
Dumper.php removed dots at the end of @param and @return 2016-06-28 08:24:06 +02:00
Escaper.php Revert "fixed typo" 2017-01-21 08:37:26 -08:00
Inline.php #20411 fix Yaml parsing for very long quoted strings 2017-03-17 09:20:23 -07:00
LICENSE updated LICENSE year 2017-01-02 12:30:00 -08:00
Parser.php bug #21523 #20411 fix Yaml parsing for very long quoted strings (RichardBradley) 2017-03-17 09:20:26 -07:00
phpunit.xml.dist Add missing exclusions from phpunit.xml.dist 2015-11-18 09:19:46 +01:00
README.md Updated all the README files 2016-03-04 08:12:06 +01:00
Unescaper.php CS: apply rules 2016-11-03 08:44:53 +01:00
Yaml.php [Yaml] Fix PHPDoc of the Yaml class 2016-07-11 09:20:55 +02:00

Yaml Component

The Yaml component loads and dumps YAML files.

Resources