summaryrefslogtreecommitdiff
path: root/program/steps/mail/get.inc
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/mail/get.inc')
-rw-r--r--program/steps/mail/get.inc25
1 files changed, 21 insertions, 4 deletions
diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc
index 924433df3..19be4bd07 100644
--- a/program/steps/mail/get.inc
+++ b/program/steps/mail/get.inc
@@ -69,8 +69,15 @@ if (!empty($_GET['_uid'])) {
// show part page
if (!empty($_GET['_frame'])) {
- if (($part_id = get_input_value('_part', RCUBE_INPUT_GPC)) && ($part = $MESSAGE->mime_parts[$part_id]) && $part->filename)
- $OUTPUT->set_pagetitle($part->filename);
+ if (($part_id = get_input_value('_part', RCUBE_INPUT_GPC)) && ($part = $MESSAGE->mime_parts[$part_id])) {
+ $filename = $part->filename;
+ if (empty($filename) && $part->mimetype == 'text/html') {
+ $filename = rcube_label('htmlmessage');
+ }
+ if (!empty($filename)) {
+ $OUTPUT->set_pagetitle($filename);
+ }
+ }
$OUTPUT->send('messagepart');
exit;
@@ -130,15 +137,25 @@ else if (strlen($pid = get_input_value('_part', RCUBE_INPUT_GET))) {
$out = rcmail_print_body($part, array('safe' => $MESSAGE->is_safe, 'inline_html' => false));
}
- $OUTPUT = new rcube_html_page();
+ $OUTPUT = new rcube_output_html();
$OUTPUT->write($out);
}
else {
// don't kill the connection if download takes more than 30 sec.
@set_time_limit(0);
+ if ($part->filename) {
+ $filename = $part->filename;
+ }
+ else if ($part->mimetype == 'text/html') {
+ $filename = rcube_label('htmlmessage');
+ }
+ else {
+ $filename = ($MESSAGE->subject ? $MESSAGE->subject : 'roundcube');
+ }
+
$ext = '.' . ($mimetype == 'text/plain' ? 'txt' : $ctype_secondary);
- $filename = $part->filename ? $part->filename : ($MESSAGE->subject ? $MESSAGE->subject : 'roundcube') . $ext;
+ $filename .= $ext;
$filename = preg_replace('[\r\n]', '', $filename);
if ($browser->ie && $browser->ver < 7)