Skip to content

Commit

Permalink
Dev: CSV export : echo only if not file
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Nov 7, 2017
1 parent f73efcd commit 0ec5902
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions application/helpers/admin/export/CsvWriter.php
Expand Up @@ -88,10 +88,11 @@ protected function outputRecord($headers, $values, FormattingOptions $oOptions)
public function close()
{
// Output white line at the end, better for R import
echo "\n";
if (!is_null($this->file)) {
fwrite($this->file, "\n");
fclose($this->file);
} else {
echo "\n";
}
}

Expand All @@ -105,4 +106,4 @@ protected function csvEscape($value)
{
return CSVEscape($value);
}
}
}

0 comments on commit 0ec5902

Please sign in to comment.