Skip to content

Yaml parse fails to understand or allow %YAML #10597

@Dragonrun1

Description

@Dragonrun1

Directly from the docs at http://www.yaml.org/spec/1.2/spec.html#id2781553
A version 1.2 YAML processor must accept documents with an explicit “%YAML 1.2” directive, as well as documents lacking a “YAML” directive.

example yaml file:

%YAML 1.2

---
yapeal:
    application_agent: ""
    registered_mode: "optional"

Using:

$handler = new Yaml();
$result = $handler->parse($yapealYaml);
var_dump($result);
print PHP_EOL;

Expect:

Array
(
    [yapeal] => Array
        (
            [application_agent] =>
            [registered_mode] => optional
)

Get:

NULL

If I use %YAML 1.1 also get the same result. This is also covered in the above spec about how it should be handled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good first issueIdeal for your first contribution! (some Symfony experience may be required)Yaml

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions