Skip to content

Commit c5f718c

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: (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 c1e0024 + 0d3916a commit c5f718c

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
@@ -1476,13 +1476,13 @@ public static function getBinaryData()
14761476
data: !!binary |
14771477
SGVsbG8gd29ybGQ=
14781478
EOT
1479-
],
1479+
],
14801480
'containing spaces in block scalar' => [
14811481
<<<'EOT'
14821482
data: !!binary |
14831483
SGVs bG8gd 29ybGQ=
14841484
EOT
1485-
],
1485+
],
14861486
];
14871487
}
14881488

@@ -2967,6 +2967,11 @@ public function testParseIdeographicSpaces()
29672967
], $this->parser->parse($expected));
29682968
}
29692969

2970+
public function testSkipBlankLines()
2971+
{
2972+
$this->assertSame(['foo' => [null]], (new Parser())->parse("foo:\n-\n\n"));
2973+
}
2974+
29702975
private function assertSameData($expected, $actual)
29712976
{
29722977
$this->assertEquals($expected, $actual);

0 commit comments

Comments
 (0)