Skip to content

Commit 2305134

Browse files
committed
Merge branch '6.4' into 7.1
* 6.4: fix merge pass CSV escape characters explicitly move setting deprecation session options into a legacy group test
2 parents 28246cc + c7f1321 commit 2305134

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Profiler/FileProfilerStorage.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function find(?string $ip, ?string $url, ?int $limit, ?string $method, ?i
5555

5656
$result = [];
5757
while (\count($result) < $limit && $line = $this->readLineFromFile($file)) {
58-
$values = str_getcsv($line);
58+
$values = str_getcsv($line, ',', '"', '\\');
5959

6060
if (7 > \count($values)) {
6161
// skip invalid lines
@@ -186,7 +186,7 @@ public function write(Profile $profile): bool
186186
$profile->getParentToken(),
187187
$profile->getStatusCode(),
188188
$profile->getVirtualType() ?? 'request',
189-
]);
189+
], ',', '"', '\\');
190190
fclose($file);
191191

192192
if (1 === mt_rand(1, 10)) {
@@ -324,7 +324,7 @@ private function removeExpiredProfiles(): void
324324
}
325325

326326
while ($line = fgets($handle)) {
327-
$values = str_getcsv($line);
327+
$values = str_getcsv($line, ',', '"', '\\');
328328

329329
if (7 > \count($values)) {
330330
// skip invalid lines

Tests/Profiler/FileProfilerStorageTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,12 @@ public function testMultiRowIndexFile()
343343

344344
$handle = fopen($this->tmpDir.'/index.csv', 'r');
345345
for ($i = 0; $i < $iteration; ++$i) {
346-
$row = fgetcsv($handle);
346+
$row = fgetcsv($handle, null, ',', '"', '\\');
347347
$this->assertEquals('token'.$i, $row[0]);
348348
$this->assertEquals('127.0.0.'.$i, $row[1]);
349349
$this->assertEquals('http://foo.bar/'.$i, $row[3]);
350350
}
351-
$this->assertFalse(fgetcsv($handle));
351+
$this->assertFalse(fgetcsv($handle, null, ',', '"', '\\'));
352352
}
353353

354354
/**

0 commit comments

Comments
 (0)