diff options
-rw-r--r-- | system/libraries/Zip.php | 7 |
1 files changed, 6 insertions, 1 deletions
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'); |