Browse Source

dev 2020-03

Max F 5 years ago
parent
commit
8cb2d7bafa
1 changed files with 3 additions and 1 deletions
  1. 3 1
      helpers/helpers_array.php

+ 3 - 1
helpers/helpers_array.php

@@ -120,6 +120,8 @@ if (! function_exists('get_csv')) {
 
 if (! function_exists('exportToCsvFile')) {
 	function exportToCsvFile($rows, $export_filename=null, $fields=null) {
+		$csv_content = get_csv($rows, $fields);
+		
 		if (! empty($export_filename)) {
 			// download file
 			header('Content-Type: text/csv');
@@ -131,7 +133,7 @@ if (! function_exists('exportToCsvFile')) {
 			header('Content-Type: text/plain');
 		}
 
-		echo get_csv($rows, $fields);
+		echo $csv_content;
 		exit;
 	}
 }