summaryrefslogtreecommitdiff
path: root/program/steps/mail/compose.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-04-13 08:52:02 +0000
committeralecpl <alec@alec.pl>2012-04-13 08:52:02 +0000
commit0c259682f65eaaf23ea4ccb56a706d6baf3007e4 (patch)
treef1491f39189c8a970e7612b9dcc20f9409d7361e /program/steps/mail/compose.inc
parentce64332e7a9bf2468eabdb4b789270aebb3e7dc7 (diff)
- Merge devel-framework branch, resolved conflicts
Diffstat (limited to 'program/steps/mail/compose.inc')
-rw-r--r--program/steps/mail/compose.inc16
1 files changed, 14 insertions, 2 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index ebf79be4e..c0a5bf7bc 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -1162,10 +1162,22 @@ function rcmail_save_attachment(&$message, $pid)
$data = $message->get_part_content($pid);
}
+ $mimetype = $part->ctype_primary . '/' . $part->ctype_secondary;
+ $filename = $part->filename;
+ if (!strlen($filename)) {
+ if ($mimetype == 'text/html') {
+ $filename = rcube_label('htmlmessage');
+ }
+ else {
+ $filename = 'Part_'.$pid;
+ }
+ $filename .= '.' . $part->ctype_secondary;
+ }
+
$attachment = array(
'group' => $COMPOSE['id'],
- 'name' => $part->filename ? $part->filename : 'Part_'.$pid.'.'.$part->ctype_secondary,
- 'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
+ 'name' => $filename,
+ 'mimetype' => $mimetype,
'content_id' => $part->content_id,
'data' => $data,
'path' => $path,