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

Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6ce42d9

Browse files
Merge branch '6.4' into 7.1
* 6.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 6c5b9cf + c8743d4 commit 6ce42d9

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

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

+14
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

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ CHANGELOG
1212
* Add `PhpSubprocess` to handle PHP subprocesses that take over the
1313
configuration from their parent
1414
* Add `RunProcessMessage` and `RunProcessMessageHandler`
15-
* Support using `Process::findExecutable()` independently of `open_basedir`
1615

1716
5.2.0
1817
-----

src/Symfony/Component/Yaml/Inline.php

+8
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

+7
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)
0