summaryrefslogtreecommitdiff
path: root/program/steps/mail/get.inc
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-12-11 08:31:07 +0100
committerAleksander Machniak <alec@alec.pl>2012-12-11 08:31:07 +0100
commit25bf00ecbc2cab20ce66845513980b83b03f7c49 (patch)
treebc5bda79cbafd35ed1c2d5e4461d43dca8324f49 /program/steps/mail/get.inc
parentd9f109b56af2015eae7aadc5e87c06365854eda0 (diff)
parent31521613e40bb57f430591bab30de2c202637db2 (diff)
Merge branch 'master' of github.com:roundcube/roundcubemail
Diffstat (limited to 'program/steps/mail/get.inc')
-rw-r--r--program/steps/mail/get.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc
index 7f06feb1a..314a437e7 100644
--- a/program/steps/mail/get.inc
+++ b/program/steps/mail/get.inc
@@ -266,6 +266,11 @@ else if (strlen($pid = get_input_value('_part', RCUBE_INPUT_GET))) {
$filename = str_ireplace('attachment', 'attach', $filename);
}
+ // add filename extension if missing
+ if (!pathinfo($filename, PATHINFO_EXTENSION) && ($extensions = rcube_mime::get_mime_extensions($mimetype))) {
+ $filename .= '.' . $extensions[0];
+ }
+
header("Content-Disposition: $disposition; filename=\"$filename\"");
// handle tiff to jpeg conversion