8000 [Yaml] fix for wrong parsing functionality on some indentation cases by dekelev · Pull Request #8100 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Yaml] fix for wrong parsing functionality on some indentation cases #8100

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Symfony/Component/Yaml/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport =
$data[] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport);
}
}
$context = null;
} elseif (preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->currentLine, $values)) {
if ($context && 'sequence' == $context) {
throw new ParseException('You cannot define a mapping item when in a sequence');
Expand Down Expand Up @@ -189,6 +190,7 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport =
$data[$key] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport);
}
}
$context = null;
} else {
// 1-liner optionally followed by newline
$lineCount = count($this->lines);
Expand Down
0