From 77e8100669fefa0deece04bf0065807f9ce1fded Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 21 Sep 2015 12:45:25 +0300 Subject: add date suffixes to opml & import_export generated files --- plugins/import_export/init.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/import_export/init.php b/plugins/import_export/init.php index e61b62b67..b6693f05c 100644 --- a/plugins/import_export/init.php +++ b/plugins/import_export/init.php @@ -106,11 +106,13 @@ class Import_Export extends Plugin implements IHandler { if (file_exists($exportname)) { header("Content-type: text/xml"); + $timestamp_suffix = date("Y-m-d", filemtime($exportname)); + if (function_exists('gzencode')) { - header("Content-Disposition: attachment; filename=TinyTinyRSS_exported.xml.gz"); + header("Content-Disposition: attachment; filename=TinyTinyRSS_exported_${timestamp_suffix}.xml.gz"); echo gzencode(file_get_contents($exportname)); } else { - header("Content-Disposition: attachment; filename=TinyTinyRSS_exported.xml"); + header("Content-Disposition: attachment; filename=TinyTinyRSS_exported_${timestamp_suffix}.xml"); echo file_get_contents($exportname); } } else { -- cgit v1.2.3-54-g00ecf