Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Yaml] parses misplaced keys in strings #27874

Copy link
Copy link
Closed
@xabbuh

Description

@xabbuh
Issue body actions

Symfony version(s) affected: 3.x/4.x

Description

When you use a mapping key in a multi-line string, that value is mistakenly treated as part of the string while it should lead to a parser error instead.

How to reproduce

use Symfony\Component\Yaml\Yaml;

$yaml = <<<EOT
doctrine:
    dbal:yeah
        default_connection: monolith
EOT;

print_r(Yaml::parse($yaml));

ends up in this result:

Array
(
    [doctrine] => dbal:yeah default_connection: monolith
)

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.