Skip to content

Commit b6a22cc

Browse files
committed
Escaping CSV Headings to fix the case of a heading including a comma
1 parent def1295 commit b6a22cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

application/libraries/Format.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public function to_csv()
197197
$data = array($data);
198198
}
199199

200-
$output = implode(',', $headings).PHP_EOL;
200+
$output = '"'.implode('","', $headings).'"'.PHP_EOL;
201201
foreach ($data as &$row)
202202
{
203203
$output .= '"'.implode('","', $row).'"'.PHP_EOL;

0 commit comments

Comments
 (0)