diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-03-19 22:36:24 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-03-19 22:36:24 +0000 |
| commit | 5ab9c6f623ea09cddc8c9729418f87df4f578e75 (patch) | |
| tree | 24e873f9a490a1b10c22c92059ce0bb45c763848 /roundcubemail/program/steps/mail/compose.inc | |
| parent | 542100f52706cb2b433250d9d8d10c039b8becaa (diff) | |
Correctly parse message/rfc822; fixed html2text conversion; code cleanup
git-svn-id: https://svn.roundcube.net/trunk@511 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/compose.inc')
| -rw-r--r-- | roundcubemail/program/steps/mail/compose.inc | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/roundcubemail/program/steps/mail/compose.inc b/roundcubemail/program/steps/mail/compose.inc index 1c2639d9b..a794e9814 100644 --- a/roundcubemail/program/steps/mail/compose.inc +++ b/roundcubemail/program/steps/mail/compose.inc @@ -401,8 +401,8 @@ function rcmail_compose_body($attrib) $body = rcmail_first_text_part($MESSAGE); $isHtml = false; } - if (strlen($body)) - $body = rcmail_create_forward_body($body, $isHtml); + + $body = rcmail_create_forward_body($body, $isHtml); } else if ($compose_mode == RCUBE_COMPOSE_DRAFT) { @@ -564,10 +564,9 @@ function rcmail_create_forward_body($body, $bodyIsHtml) } // add attachments - if (!isset($_SESSION['compose']['forward_attachments']) && - is_array($MESSAGE['parts']) && sizeof($MESSAGE['parts'])>1) + if (!isset($_SESSION['compose']['forward_attachments']) && is_array($MESSAGE['parts'])) rcmail_write_compose_attachments($MESSAGE); - + return $prefix.$body; } @@ -598,7 +597,7 @@ function rcmail_write_compose_attachments(&$message) { if ($part->ctype_primary != 'message' && $part->ctype_primary != 'text' && ($part->disposition=='attachment' || $part->disposition=='inline' || $part->headers['content-id'] || - (empty($part->disposition) && ($part->d_parameters['filename'] || $part->ctype_parameters['name'])))) + (empty($part->disposition) && $part->filename))) { $tmp_path = tempnam($temp_dir, 'rcmAttmnt'); if ($fp = fopen($tmp_path, 'w')) @@ -606,13 +605,9 @@ function rcmail_write_compose_attachments(&$message) fwrite($fp, $IMAP->get_message_part($message['UID'], $pid, $part->encoding)); fclose($fp); - $filename = !empty($part->d_parameters['filename']) ? $part->d_parameters['filename'] : - (!empty($part->ctype_parameters['name']) ? $part->ctype_parameters['name'] : - (!empty($part->headers['content-description']) ? $part->headers['content-description'] : 'file')); - $_SESSION['compose']['attachments'][] = array( - 'name' => rcube_imap::decode_mime_string($filename), 'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary, + 'name' => $part->filename, 'path' => $tmp_path ); } |
