From 33dd95d7cb8ac2f6b8da447966a750bdb064fc48 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 1 Oct 2006 19:20:42 +0000 Subject: --- system/libraries/Zip.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'system/libraries') diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 2ffed9fe2..a11699956 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -261,8 +261,13 @@ class CI_Zip { * @param string the data to be encoded * @return bool */ - function download($filename) + function download($filename = 'backup.zip') { + if ( ! preg_match("|.+?\.zip$|", $filename)) + { + $filename .= '.zip'; + } + if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) { header('Content-Type: application/x-zip'); -- cgit v1.2.3-24-g4f1b