Skip to content

Navigation Menu

Sign in
Appearance settings

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 b4e942d

Browse filesBrowse files
radar3301nicolas-grekas
authored andcommitted
Update FileProfilerStorage.php
fix "Undefined array key" by skipping invalid/corrupted lines
1 parent 09f5778 commit b4e942d
Copy full SHA for b4e942d

File tree

1 file changed

+9
-1
lines changed
Filter options

1 file changed

+9
-1
lines changed

‎src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,15 @@ private function removeExpiredProfiles(): void
315315
}
316316

317317
while ($line = fgets($handle)) {
318-
[$csvToken, , , , $csvTime] = str_getcsv($line);
318+
$values = str_getcsv($line);
319+
320+
if (7 !== \count($values)) {
321+
// skip invalid lines
322+
$offset += \strlen($line);
323+
continue;
324+
}
325+
326+
[$csvToken, , , , $csvTime] = $values;
319327

320328
if ($csvTime >= $minimalProfileTimestamp) {
321329
break;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.