Skip to content

Commit 0d3916a

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: (22 commits) fix merge [AssetMapper] Check asset/vendor directory is writable detect wrong e-mail validation modes detect wrong usages of minMessage/maxMessage in options [Security] Remove workflow from empty folder read form values using the chain data accessor [Validator] Review Bulgarian (bg) translation Reviewed italian translation Fix french translation call substr() with integer offsets [Finder] Also consider .git inside the basedir of in() directory review: FR translation [Serializer] Add AbstractNormalizerContextBuilder::defaultConstructorArguments() Update spanish and catalan translations Update AbstractSchemaListener.php to adjust more database params Updated id=113 Arabic translation. #53771 Updated validator Lithuanian translations review: translation RU [PropertyInfo] Fix PHPStan properties type in trait explicitly cast boolean SSL stream options ...
2 parents cbe25f6 + 53e8b1e commit 0d3916a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,12 +633,12 @@ private function getNextEmbedBlock(?int $indentation = null, bool $inSequence =
633633
}
634634

635635
if ($this->isCurrentLineBlank()) {
636-
$data[] = substr($this->currentLine, $newIndent);
636+
$data[] = substr($this->currentLine, $newIndent ?? 0);
637637
continue;
638638
}
639639

640640
if ($indent >= $newIndent) {
641-
$data[] = substr($this->currentLine, $newIndent);
641+
$data[] = substr($this->currentLine, $newIndent ?? 0);
642642
} elseif ($this->isCurrentLineComment()) {
643643
$data[] = $this->currentLine;
644644
} elseif (0 == $indent) {

Tests/ParserTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,13 +1475,13 @@ public static function getBinaryData()
14751475
data: !!binary |
14761476
SGVsbG8gd29ybGQ=
14771477
EOT
1478-
],
1478+
],
14791479
'containing spaces in block scalar' => [
14801480
<<<'EOT'
14811481
data: !!binary |
14821482
SGVs bG8gd 29ybGQ=
14831483
EOT
1484-
],
1484+
],
14851485
];
14861486
}
14871487

@@ -2957,6 +2957,11 @@ public function testParseIdeographicSpaces()
29572957
], $this->parser->parse($expected));
29582958
}
29592959

2960+
public function testSkipBlankLines()
2961+
{
2962+
$this->assertSame(['foo' => [null]], (new Parser())->parse("foo:\n-\n\n"));
2963+
}
2964+
29602965
private function assertSameData($expected, $actual)
29612966
{
29622967
$this->assertEquals($expected, $actual);

0 commit comments

Comments
 (0)