-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Yaml] Syntax error not detected in first line of object #33243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
what is the result of the parsing ? |
Hmm, when reporting a parser bug it obviously makes sense to put in the parse result.. ^^ |
For completeness' sake: php > echo strtr($config, ["\r" => '#13', "\n" => '#10']);
paths:#10 abc#10 abc: def#10 |
Since #27898 which is part of Symfony 4.3 the given example should trigger a deprecation warning ("Support for mapping keys in multi-line blocks is deprecated") and will fail with a @SamMousa Can you confirm that's the case or create a small reproducible example application otherwise? |
Added to my todo.! |
@SamMousa Did you manage to check for the deprecation? |
Yes, just confirmed it. require 'vendor/autoload.php';
use Symfony\Component\Yaml\Yaml;
$yaml = <<<YAML
paths:
abc
abc: def
YAML;
set_error_handler(function($code, $message, $file, $line, $context) {
throw new \Exception($message);
});
Yaml::parse($yaml); Result:
|
Symfony version(s) affected: v4.3.3
Description
A syntax error is ignored by the parser.
How to reproduce
This code:
is successfully parsed but it is not valid YAML.
Additional context
The following online parsers identify the error
I have found several others that also identify the error correctly.
The text was updated successfully, but these errors were encountered: