Skip to content

Commit d8f1a9a

Browse files
authored
fix: handle empty enclosure string for PHP 8.4 str_getcsv compatibility
1 parent d1edcc1 commit d8f1a9a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/Interpreter/Functions/Util/Csv_To_Table.php

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

34+
// PHP 8.4+ requires enclosure to be exactly one character; use null byte to disable quoting when empty string is given
35+
$enclosure = $enclosure !== '' ? $enclosure : "\0";
36+
3437
$csvTable = [];
3538
while ($line = fgets($fileStream)) {
3639
$csvTable[] = $this->reindex(str_getcsv($line, $separator, $enclosure));

0 commit comments

Comments
 (0)