Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e8dc1c2

Browse files
bug #50913 [HttpKernel][WebProfilerBundle] Fix search feature (Cyril HERRERA)
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [HttpKernel][WebProfilerBundle] Fix search feature | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - This fix research feature in the profiler. Sometimes lines in index.csv are broken with something like this : ,,200 the try and catch allow the profiler to skip these lines Commits ------- cffceb1 [HttpKernel][WebProfilerBundle] Fix search feature
2 parents fbd3988 + cffceb1 commit e8dc1c2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ public function find(?string $ip, ?string $url, ?int $limit, ?string $method, in
6161
$result = [];
6262
while (\count($result) < $limit && $line = $this->readLineFromFile($file)) {
6363
$values = str_getcsv($line);
64+
65+
if (7 !== \count($values)) {
66+
// skip invalid lines
67+
continue;
68+
}
69+
6470
[$csvToken, $csvIp, $csvMethod, $csvUrl, $csvTime, $csvParent, $csvStatusCode] = $values;
6571
$csvTime = (int) $csvTime;
6672

0 commit comments

Comments
 (0)