Skip to content

Commit 96baa90

Browse files
Merge branch '7.1' into 7.2
* 7.1: [Process] minor fix [Process] Fix finding executables independently of open_basedir [HttpKernel] Skip logging uncaught exceptions in ErrorHandler, assume $kernel->terminateWithException() will do it [Serializer] Fix for method named `get()` [Notifier][TurboSMS] Process partial accepted response from transport parse empty sequence elements as null [HttpClient] Fix setting CURLMOPT_MAXCONNECTS throw a meaningful exception when parsing dotenv files with BOM [FrameworkBundle] Fix schema & finish incomplete tests for lock & semaphore config [Cache] Fix RedisSentinel params types [FrameworkBundle] Fix service reset between tests [Uid][Serializer][Validator] Mention RFC 9562 make sure temp files can be cleaned up on Windows
2 parents 4bc6a9f + 4e561c3 commit 96baa90

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Inline.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,18 @@ private static function parseSequence(string $sequence, int $flags, int &$i = 0,
353353
++$i;
354354

355355
// [foo, bar, ...]
356+
$lastToken = null;
356357
while ($i < $len) {
357358
if (']' === $sequence[$i]) {
358359
return $output;
359360
}
360361
if (',' === $sequence[$i] || ' ' === $sequence[$i]) {
362+
if (',' === $sequence[$i] && (null === $lastToken || 'separator' === $lastToken)) {
363+
$output[] = null;
364+
} elseif (',' === $sequence[$i]) {
365+
$lastToken = 'separator';
366+
}
367+
361368
++$i;
362369

363370
continue;
@@ -401,6 +408,7 @@ private static function parseSequence(string $sequence, int $flags, int &$i = 0,
401408

402409
$output[] = $value;
403410

411+
$lastToken = 'value';
404412
++$i;
405413
}
406414

Tests/InlineTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,4 +1140,11 @@ public function testParseQuotedReferenceLikeStringsInSequence()
11401140

11411141
$this->assertSame(['&foo', '&bar', '&baz'], Inline::parse($yaml));
11421142
}
1143+
1144+
public function testParseSequenceWithEmptyElement()
1145+
{
1146+
$this->assertSame(['foo', null, 'bar'], Inline::parse('[foo, , bar]'));
1147+
$this->assertSame([null, 'foo', 'bar'], Inline::parse('[, foo, bar]'));
1148+
$this->assertSame(['foo', 'bar'], Inline::parse('[foo, bar, ]'));
1149+
}
11431150
}

0 commit comments

Comments
 (0)