Skip to content

Commit

Permalink
#20: Add .csv extension to CSV-download filename
Browse files Browse the repository at this point in the history
  • Loading branch information
lat9 committed Dec 23, 2019
1 parent 4303a1b commit a35c08b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,11 @@ Modified:
/YOUR_ADMIN/includes/functions/extra_functions/stats_sales_report.php

=====================================
Changes in 3.3.3, 2019-11-02 (lat9)
Changes in 3.3.3, 2019-12-23 (lat9)
=====================================
[BUGFIX] Correct no admin-menu entry on a "fresh" install.
[BUGFIX] Correct 'goods' value when the store doesn't display prices with tax (the tax was incorrectly being removed from the price).
[BUGFIX] Correct suggested CSV-download filename (didn't include the .csv extension).

Modified:
/YOUR_ADMIN/includes/classes/sales_report.php
Expand Down
4 changes: 2 additions & 2 deletions YOUR_ADMIN/includes/classes/sales_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -909,15 +909,15 @@ function output_csv($csv_header)
$filename = CSV_FILENAME_PREFIX . date('Ymd', $this->sd_raw) . "-" . date('Ymd', $this->ed_raw);
if (preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT'])) {
header('Content-Type: application/octetstream');
header('Content-Disposition: attachment; filename=' . $filename);
header('Content-Disposition: attachment; filename=' . $filename . '.csv');
header("Expires: Mon, 26 Jul 2001 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: must_revalidate, post-check=0, pre-check=0");
header("Pragma: public");
header("Cache-control: private");
} else {
header('Content-Type: application/x-octet-stream');
header('Content-Disposition: attachment; filename=' . $filename);
header('Content-Disposition: attachment; filename=' . $filename . '.csv');
header("Expires: Mon, 26 Jul 2001 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Pragma: no-cache");
Expand Down

0 comments on commit a35c08b

Please sign in to comment.