You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Inline.php
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -274,7 +274,7 @@ public static function parseScalar(string $scalar, int $flags = 0, array $delimi
274
274
$output = self::parseQuotedScalar($scalar, $i);
275
275
276
276
if (null !== $delimiters) {
277
-
$tmp = ltrim(substr($scalar, $i), '');
277
+
$tmp = ltrim(substr($scalar, $i), "\n");
278
278
if ('' === $tmp) {
279
279
thrownewParseException(sprintf('Unexpected end of line, expected one of "%s".', implode('', $delimiters)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
280
280
}
@@ -419,6 +419,7 @@ private static function parseMapping(string $mapping, int $flags, int &$i = 0, a
419
419
switch ($mapping[$i]) {
420
420
case'':
421
421
case',':
422
+
case"\n":
422
423
++$i;
423
424
continue2;
424
425
case'}':
@@ -450,7 +451,7 @@ private static function parseMapping(string $mapping, int $flags, int &$i = 0, a
thrownewParseException('Colons must be followed by a space or an indication character (i.e. " ", ",", "[", "]", "{", "}").', self::$parsedLineNumber + 1, $mapping);
455
456
}
456
457
@@ -459,7 +460,7 @@ private static function parseMapping(string $mapping, int $flags, int &$i = 0, a
459
460
}
460
461
461
462
while ($i < $len) {
462
-
if (':' === $mapping[$i] || '' === $mapping[$i]) {
// do not take following lines into account when the current line is a quoted single line value
@@ -1072,4 +1133,122 @@ private function getLineTag(string $value, int $flags, bool $nextLineCheck = tru
1072
1133
1073
1134
thrownewParseException(sprintf('Tags support is not enabled. You must use the flag "Yaml::PARSE_CUSTOM_TAGS" to use "%s".', $matches['tag']), $this->getRealCurrentLineNb() + 1, $value, $this->filename);
0 commit comments