diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-03-06 11:30:12 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-03-06 11:30:12 +0000 |
commit | f0755f6daf0713c360b4ac99ca3ce82e9d4c421e (patch) | |
tree | 2feb34b9ae8114ee2f8b1d2c313980889355ef38 /phpBB/includes/functions_compress.php | |
parent | 1070cf800fd9a101a50bb89fe9c6571e5651ef72 (diff) | |
download | forums-f0755f6daf0713c360b4ac99ca3ce82e9d4c421e.tar forums-f0755f6daf0713c360b4ac99ca3ce82e9d4c421e.tar.gz forums-f0755f6daf0713c360b4ac99ca3ce82e9d4c421e.tar.bz2 forums-f0755f6daf0713c360b4ac99ca3ce82e9d4c421e.tar.xz forums-f0755f6daf0713c360b4ac99ca3ce82e9d4c421e.zip |
safer name for the updater downloads (even if removed after download) - reported by SHS`
git-svn-id: file:///svn/phpbb/trunk@7134 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_compress.php')
-rw-r--r-- | phpBB/includes/functions_compress.php | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index 3fe2bf9a9b..d8267cf7f6 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -419,15 +419,20 @@ class compress_zip extends compress /** * Download archive */ - function download($filename) + function download($filename, $download_name = false) { global $phpbb_root_path; + if ($download_name === false) + { + $download_name = $filename; + } + $mimetype = 'application/zip'; header('Pragma: no-cache'); - header("Content-Type: $mimetype; name=\"$filename.zip\""); - header("Content-disposition: attachment; filename=$filename.zip"); + header("Content-Type: $mimetype; name=\"$download_name.zip\""); + header("Content-disposition: attachment; filename=$download_name.zip"); $fp = fopen("{$phpbb_root_path}store/$filename.zip", 'rb'); while ($buffer = fread($fp, 1024)) @@ -611,10 +616,15 @@ class compress_tar extends compress /** * Download archive */ - function download($filename) + function download($filename, $download_name = false) { global $phpbb_root_path; + if ($download_name === false) + { + $download_name = $filename; + } + switch ($this->type) { case '.tar': @@ -635,8 +645,8 @@ class compress_tar extends compress } header('Pragma: no-cache'); - header("Content-Type: $mimetype; name=\"$filename$this->type\""); - header("Content-disposition: attachment; filename=$filename$this->type"); + header("Content-Type: $mimetype; name=\"$download_name$this->type\""); + header("Content-disposition: attachment; filename=$download_name$this->type"); $fp = fopen("{$phpbb_root_path}store/$filename$this->type", 'rb'); while ($buffer = fread($fp, 1024)) |