8000 Merge branch '5.4' into 6.4 · symfony/symfony@c8743d4 · GitHub
[go: up one dir, main page]

Skip to content

Commit c8743d4

Browse files
Merge branch '5.4' into 6.4
* 5.4: [Process] minor fix [Process] Fix finding executables independently of open_basedir [HttpKernel] Skip logging uncaught exceptions in ErrorHandler, assume $kernel->terminateWithException() will do it parse empty sequence elements as null
2 parents d8bc0eb + f5fd55a commit c8743d4

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public function configure(?object $event = null): void
6767
return;
6868
}
6969
$this->firstCall = $this->hasTerminatedWithException = false;
70+
$hasRun = null;
7071

7172
if (!$this->exceptionHandler) {
7273
if ($event instanceof KernelEvent) {
@@ -103,6 +104,19 @@ public function configure(?object $event = null): void
103104

104105
if ($handler instanceof ErrorHandler) {
105106
$handler->setExceptionHandler($this->exceptionHandler);
107+
if (null !== $hasRun) {
108+
$throwAt = $handler->throwAt(0) | \E_ERROR | \E_CORE_ERROR | \E_COMPILE_ERROR | \E_USER_ERROR | \E_RECOVERABLE_ERROR | \E_PARSE;
109+
$loggers = [];
110+
111+
foreach ($handler->setLoggers([]) as $type => $log) {
112+
if ($type & $throwAt) {
113+
$loggers[$type] = [null, $log[1]];
114+
}
115+
}
116+
117+
// Assume $kernel->terminateWithException() will log uncaught exceptions appropriately
118+
$handler->setLoggers($loggers);
119+
}
106120
}
107121
$this->exceptionHandler = null;
108122
}

src/Symfony/Component/Process/CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ CHANGELOG
77
* Add `PhpSubprocess` to handle PHP subprocesses that take over the
88
configuration from their parent
99
* Add `RunProcessMessage` and `RunProcessMessageHandler`
10-
* Support using `Process::findExecutable()` independently of `open_basedir`
1110

1211
5.2.0
1312
-----

src/Symfony/Component/Yaml/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

src/Symfony/Component/Yaml/Tests/InlineTest.php

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

11291129
$this->assertSame(['&foo', '&bar', '&baz'], Inline::parse($yaml));
11301130
}
1131+
1132+
public function testParseSequenceWithEmptyElement()
1133+
{
1134+
$this->assertSame(['foo', null, 'bar'], Inline::parse('[foo, , bar]'));
1135+
$this->assertSame([null, 'foo', 'bar'], Inline::parse('[, foo, bar]'));
1136+
$this->assertSame(['foo', 'bar'], Inline::parse('[foo, bar, ]'));
1137+
}
11311138
}

0 commit comments

Comments
 (0)
0