Skip to content

Commit cefa36a

Browse files
author
Phil Sturgeon
committed
Merge pull request chriskacerguis#210 from mohabusama/master
Escaping CSV headings
2 parents 00a93dc + b6a22cc commit cefa36a

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
$row = str_replace('"', '""', $row); // Escape dbl quotes per RFC 4180

0 commit comments

Comments
 (0)