We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d767cb commit b7fe4abCopy full SHA for b7fe4ab
application/libraries/Format.php
@@ -200,8 +200,13 @@ public function to_csv()
200
$output = '"'.implode('","', $headings).'"'.PHP_EOL;
201
foreach ($data as &$row)
202
{
203
- $row = str_replace('"', '""', $row); // Escape dbl quotes per RFC 4180
204
- $output .= '"'.implode('","', $row).'"'.PHP_EOL;
+ if (is_array($row)) {
+ throw new Exception('Format class does not support multi-dimensional arrays');
205
+ } else {
206
+ $row = str_replace('"', '""', $row); // Escape dbl quotes per RFC 4180
207
+ $output .= '"'.implode('","', $row).'"'.PHP_EOL;
208
+ }
209
+
210
}
211
212
return $output;
0 commit comments