Skip to content

Commit c58f77f

Browse files
committed
bug #47238 [HttpKernel] Fix passing null to \trim() method in LoggerDataCollector (SVillette)
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [HttpKernel] Fix passing `null` to `\trim()` method in LoggerDataCollector | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #47235 | License | MIT | Doc PR | - The full explanation of the bug context is described in the [reproducer](https://github.com/SVillette/SymfonyTrimDeprecationReproducer) repository To be short, the fact of logging deprecations in dev environment and accessing the deprecations panel in the profiler triggered a PHP deprecation because the `\trim()` method was called with `null`. Commits ------- b2fea03 [HttpKernel] Fix passing `null` to `\trim()` method in LoggerDataCollector
2 parents 09b8854 + b2fea03 commit c58f77f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function getFilters()
144144

145145
$allChannels = [];
146146
foreach ($this->getProcessedLogs() as $log) {
147-
if ('' === trim($log['channel'])) {
147+
if ('' === trim($log['channel'] ?? '')) {
148148
continue;
149149
}
150150

0 commit comments

Comments
 (0)