bug #21912 [Yaml] dump escape sequences when possible (xabbuh)

This PR was merged into the 3.2 branch.

Discussion
----------

[Yaml] dump escape sequences when possible

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

Tests for them have been introduced in #21903 (in 2.7 and 2.8 this does not need to be fixed as those versions didn't dump the `!!binary` tag).

Commits
-------

997103d [Yaml] dump escape sequences when possible
This commit is contained in:
Nicolas Grekas 2017-03-07 17:54:16 +01:00
commit d3c55c51d6

View File

@ -688,7 +688,7 @@ class Inline
private static function isBinaryString($value)
{
return !preg_match('//u', $value) || preg_match('/[^\x09-\x0d\x20-\xff]/', $value);
return !preg_match('//u', $value) || preg_match('/[^\x00\x07-\x0d\x1B\x20-\xff]/', $value);
}
/**