File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/Symfony/Component/Yaml Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -421,7 +421,7 @@ private function doParse($value, $flags)
421
421
}
422
422
423
423
// try to parse the value as a multi-line string as a last resort
424
- if (0 === $ this ->currentLineNb ) {
424
+ if (0 === $ this ->currentLineNb && ! $ this -> isNextLineIndented () ) {
425
425
$ previousLineWasNewline = false ;
426
426
$ previousLineWasTerminatedWithBackslash = false ;
427
427
$ value = '' ;
Original file line number Diff line number Diff line change @@ -812,6 +812,18 @@ public function testNonStringFollowedByCommentEmbeddedInMapping()
812
812
$ this ->assertSame ($ expected , $ this ->parser ->parse ($ yaml ));
813
813
}
814
814
815
+ /**
816
+ * @expectedException \Symfony\Component\Yaml\Exception\ParseException
817
+ */
818
+ public function testMultiLineStringLastResortParsingOnlyAffectSameIndentationLevel ()
819
+ {
820
+ $ yaml = <<<'EOT'
821
+ parse
822
+ error:
823
+ EOT;
824
+ $ this ->parser ->parse ($ yaml );
825
+ }
826
+
815
827
public function testMultiLineStringLastResortParsing ()
816
828
{
817
829
$ yaml = <<<'EOT'
You can’t perform that action at this time.
0 commit comments