This commit is contained in:
William Knauss
2014-06-05 20:36:32 -04:00
parent 17e060ea33
commit 31417caafd

View File

@@ -460,17 +460,17 @@ class parseCSV {
* @return [string] * @return [string]
*/ */
public function output ($filename = null, $data = array(), $fields = array(), $delimiter = null) { public function output ($filename = null, $data = array(), $fields = array(), $delimiter = null) {
if ( empty($filename) ) { if (empty($filename)) {
$filename = $this->output_filename; $filename = $this->output_filename;
} }
if ( $delimiter === null ) { if ($delimiter === null) {
$delimiter = $this->output_delimiter; $delimiter = $this->output_delimiter;
} }
$data = $this->unparse($data, $fields, null, null, $delimiter); $data = $this->unparse($data, $fields, null, null, $delimiter);
if ( $filename !== null ) { if (!is_null($filename)) {
header('Content-type: application/csv'); header('Content-type: application/csv');
header('Content-Length: '.strlen($data)); header('Content-Length: '.strlen($data));
header('Cache-Control: no-cache, must-revalidate'); header('Cache-Control: no-cache, must-revalidate');