summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authorsvncommit <devs@roundcube.net>2006-04-06 17:35:42 +0000
committersvncommit <devs@roundcube.net>2006-04-06 17:35:42 +0000
commita43e0c95cb6004ce67c7dc357eb6683851895fcb (patch)
tree09a391e154fee9e031b16c9f6194c424a5b6ab4e /program/steps
parent2e2fe047388783026d180b920b31f8d209bd0e1a (diff)
Corrected issue forwarding attachments without disposition headers
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/compose.inc31
1 files changed, 19 insertions, 12 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index b616f0758..5969e05a8 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -396,19 +396,26 @@ function rcmail_create_forward_body($body)
foreach ($FORWARD_MESSAGE['parts'] as $part)
{
- if ($part->disposition != 'attachment')
- continue;
-
- $tmp_path = tempnam($temp_dir, 'rcmAttmnt');
- if ($fp = fopen($tmp_path, 'w'))
- {
- fwrite($fp, $IMAP->mime_decode($part->body, $part->headers['content-transfer-encoding']));
- fclose($fp);
+ if ($part->disposition=='attachment' || $part->disposition=='inline' || $part->headers['content-id'] ||
+ (empty($part->disposition) && ($part->d_parameters['filename'] || $part->ctype_parameters['name'])))
+ {
+ $tmp_path = tempnam($temp_dir, 'rcmAttmnt');
+ if ($fp = fopen($tmp_path, 'w'))
+ {
+ fwrite($fp, $IMAP->mime_decode($part->body, $part->headers['content-transfer-encoding']));
+ fclose($fp);
- $_SESSION['compose']['attachments'][] = array('name' => $part->d_parameters['filename'],
- 'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
- 'path' => $tmp_path);
- }
+ if ($part->d_parameters['filename'])
+ $_SESSION['compose']['attachments'][] = array('name' => $part->d_parameters['filename'],
+ 'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
+ 'path' => $tmp_path);
+
+ else if ($part->ctype_parameters['name'])
+ $_SESSION['compose']['attachments'][] = array('name' => $part->ctype_parameters['name'],
+ 'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
+ 'path' => $tmp_path);
+ }
+ }
}
$_SESSION['compose']['forward_attachments'] = TRUE;