Skip to content

Commit f4da323

Browse files
committed
functions\csv_to_table: make compatible with php 8.4
Signed-off-by: Raul Ferreira Fuentes <r.ferreira.fuentes@gmail.com>
1 parent d1edcc1 commit f4da323

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/Interpreter/Functions/Util/Csv_To_Table.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@ public function run(array $input = [], string $separator = ',', string $enclosur
3131
return [];
3232
}
3333

34+
if (strlen($enclosure) !== 1) {
35+
$enclosure = '"';
36+
}
37+
3438
$csvTable = [];
3539
while ($line = fgets($fileStream)) {
36-
$csvTable[] = $this->reindex(str_getcsv($line, $separator, $enclosure));
40+
$csvTable[] = $this->reindex(str_getcsv($line, $separator, $enclosure, "\\"));
3741
}
3842
fclose($fileStream);
3943
return $this->reindex($csvTable);

0 commit comments

Comments
 (0)