Skip to content

Commit 53e8b1e

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: detect wrong e-mail validation modes read form values using the chain data accessor [Validator] Review Bulgarian (bg) translation Reviewed italian translation Fix french translation call substr() with integer offsets review: FR translation Update spanish and catalan translations Updated id=113 Arabic translation. #53771 Updated validator Lithuanian translations review: translation RU [PropertyInfo] Fix PHPStan properties type in trait [Validator] review validators.lv.xlf Review translation
2 parents e111fe4 + bc780e1 commit 53e8b1e

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
@@ -638,12 +638,12 @@ private function getNextEmbedBlock(?int $indentation = null, bool $inSequence =
638638
}
639639

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

645645
if ($indent >= $newIndent) {
646-
$data[] = substr($this->currentLine, $newIndent);
646+
$data[] = substr($this->currentLine, $newIndent ?? 0);
647647
} elseif ($this->isCurrentLineComment()) {
648648
$data[] = $this->currentLine;
649649
} elseif (0 == $indent) {

Tests/ParserTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,13 +1478,13 @@ public static function getBinaryData()
14781478
data: !!binary |
14791479
SGVsbG8gd29ybGQ=
14801480
EOT
1481-
],
1481+
],
14821482
'containing spaces in block scalar' => [
14831483
<<<'EOT'
14841484
data: !!binary |
14851485
SGVs bG8gd 29ybGQ=
14861486
EOT
1487-
],
1487+
],
14881488
];
14891489
}
14901490

@@ -2971,6 +2971,11 @@ public function testParseIdeographicSpaces()
29712971
], $this->parser->parse($expected));
29722972
}
29732973

2974+
public function testSkipBlankLines()
2975+
{
2976+
$this->assertSame(['foo' => [null]], (new Parser())->parse("foo:\n-\n\n"));
2977+
}
2978+
29742979
private function assertSameData($expected, $actual)
29752980
{
29762981
$this->assertEquals($expected, $actual);

0 commit comments

Comments
 (0)