summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--program/include/rcube_imap.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index ba76b19c1..fa4cae57c 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -1182,8 +1182,6 @@ class rcube_imap
{
if (!empty($part->d_parameters['filename']))
$filename_mime = $part->d_parameters['filename'];
- else if (!empty($part->ctype_parameters['name']))
- $filename_mime = $part->ctype_parameters['name'];
else if (!empty($part->d_parameters['filename*']))
$filename_encoded = $part->d_parameters['filename*'];
else if (!empty($part->ctype_parameters['name*']))
@@ -1258,6 +1256,9 @@ class rcube_imap
}
}
}
+ // read 'name' after rfc2231 parameters as it may contains truncated filename (from Thunderbird)
+ else if (!empty($part->ctype_parameters['name']))
+ $filename_mime = $part->ctype_parameters['name'];
// Content-Disposition
else if (!empty($part->headers['content-description']))
$filename_mime = $part->headers['content-description'];