Skip to content

[Yaml] DEL(\x7f) is not escaped when Yaml::dump #36559

Closed
@sdkawata

Description

@sdkawata

Symfony version(s) affected: 3.4

Description
When I dump string containing DEL(\x7f), Yaml::dump output string which contains DEL.

According to YAML specification,
DEL should not be included in YAML stream.
Some implementations throw error when trying to parse YAML stream containing DEL
(e.g. js-yaml and go-yaml)

How to reproduce

use Symfony\Component\Yaml\Yaml;

file_put_contents('test.yml', Yaml::dump(["DEL->\x7f<-here"]));

test.yml contains DEL character, and thus cannot be parsed by some implementation(eg. js-yaml)

Possible Solution
DEL(\x7f) should be escaped

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions