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

Skip to content

Commit c68d9ad

Browse files
committed
prevent error happening
1 parent 5d75184 commit c68d9ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ public function find(?string $ip, ?string $url, ?int $limit, ?string $method, in
6262
while (\count($result) < $limit && $line = $this->readLineFromFile($file)) {
6363
$values = str_getcsv($line);
6464

65-
try {
66-
[$csvToken, $csvIp, $csvMethod, $csvUrl, $csvTime, $csvParent, $csvStatusCode] = $values;
67-
} catch (\ErrorException $e) {
65+
if (count($values) !== 7) {
6866
continue;
6967
}
7068

69+
[$csvToken, $csvIp, $csvMethod, $csvUrl, $csvTime, $csvParent, $csvStatusCode] = $values;
70+
7171
$csvTime = (int) $csvTime;
7272

7373
if ($ip && !str_contains($csvIp, $ip) || $url && !str_contains($csvUrl, $url) || $method && !str_contains($csvMethod, $method) || $statusCode && !str_contains($csvStatusCode, $statusCode)) {

0 commit comments

Comments
 (0)