Closed
Description
Symfony version(s) affected: 3.4.37+, 4.3.10+, 4.4.2+, 5.0.2+
Description
As of #34449 when using Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK
any multiline string with CRLF new lines will be encoded as a single line quoted string instead of a scalar block.
How to reproduce
Try to dump a string with CRLF new lines.
e.g.
$strings = [
"lf" => "multi\nline\nstring",
"crlf" => "multi\r\nline\r\nstring",
"mixed" => "multi\r\nline\nstring",
];
$yaml = Yaml::dump($strings, 2, 2, Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK);
print($yaml);
produces:
lf: |
multi
line
string
crlf: "multi\r\nline\r\nstring"
mixed: "multi\r\nline\nstring"
Possible Solution
Change explode
back to preg_split
, but I'm unsure it explode was used for a specific reason.