diff -ruN rc-beta3/program/steps/mail/compose.inc rc-beta2/program/steps/mail/compose.inc
|
old
|
new
|
|
| 522 | 522 | |
| 523 | 523 | // add attachments |
| 524 | 524 | if (!isset($_SESSION['compose']['forward_attachments']) && is_array($MESSAGE->mime_parts)) |
| 525 | | rcmail_write_compose_attachments($MESSAGE); |
| | 525 | rcmail_write_compose_attachments($MESSAGE, $bodyIsHtml); |
| 526 | 526 | |
| 527 | 527 | return $prefix.$body; |
| 528 | 528 | } |
| … |
… |
|
| 539 | 539 | if (!isset($_SESSION['compose']['forward_attachments']) |
| 540 | 540 | && is_array($MESSAGE->mime_parts) |
| 541 | 541 | && count($MESSAGE->mime_parts) > 0) |
| 542 | | rcmail_write_compose_attachments($MESSAGE); |
| | 542 | rcmail_write_compose_attachments($MESSAGE, $bodyIsHtml); |
| 543 | 543 | |
| 544 | 544 | return $body; |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | |
| 548 | | function rcmail_write_compose_attachments(&$message) |
| | 548 | function rcmail_write_compose_attachments(&$message, $bodyIsHtml) |
| 549 | 549 | { |
| 550 | 550 | global $RCMAIL, $IMAP; |
| 551 | 551 | |
| … |
… |
|
| 556 | 556 | |
| 557 | 557 | foreach ((array)$message->mime_parts as $pid => $part) |
| 558 | 558 | { |
| 559 | | if ($part->ctype_primary != 'message' && |
| | 559 | if (($part->ctype_primary != 'message' || !$bodyIsHtml) && |
| 560 | 560 | ($part->disposition=='attachment' || $part->disposition=='inline' || $part->headers['content-id'] || |
| 561 | 561 | (empty($part->disposition) && $part->filename))) |
| 562 | 562 | { |
diff -ruN rc-beta3/program/steps/mail/sendmail.inc rc-beta2/program/steps/mail/sendmail.inc
|
old
|
new
|
|
| 266 | 266 | $MAIL_MIME->setTXTBody($message_body, FALSE, TRUE); |
| 267 | 267 | } |
| 268 | 268 | |
| | 269 | // chose transfer encoding |
| | 270 | $charset_7bit = array('ASCII', 'ISO-2022-JP', 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-15'); |
| | 271 | $transfer_encoding = in_array(strtoupper($message_charset), $charset_7bit) ? '7bit' : '8bit'; |
| 269 | 272 | |
| 270 | 273 | // add stored attachments, if any |
| 271 | 274 | if (is_array($_SESSION['compose']['attachments'])) |
| … |
… |
|
| 285 | 288 | We need to replace mime_content_type in a later release because the function |
| 286 | 289 | is deprecated in favour of File_Info |
| 287 | 290 | */ |
| | 291 | $ctype = rc_mime_content_type($attachment['path'], $attachment['mimetype']); |
| | 292 | $ctype = str_replace('image/pjpeg', 'image/jpeg', $ctype); // #1484914 |
| | 293 | |
| | 294 | // .eml attachments send inline |
| 288 | 295 | $MAIL_MIME->addAttachment($attachment['path'], |
| 289 | | rc_mime_content_type($attachment['path'], $attachment['mimetype']), |
| 290 | | $attachment['name'], true, 'base64', |
| 291 | | 'attachment', $message_charset); |
| | 296 | $ctype, |
| | 297 | $attachment['name'], true, |
| | 298 | ($ctype == 'message/rfc822' ? $transfer_encoding : 'base64'), |
| | 299 | ($ctype == 'message/rfc822' ? 'inline' : 'attachment'), |
| | 300 | $message_charset); |
| 292 | 301 | } |
| 293 | 302 | } |
| 294 | 303 | |
| 295 | 304 | // add submitted attachments |
| 296 | 305 | if (is_array($_FILES['_attachments']['tmp_name'])) |
| 297 | 306 | foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath) |
| 298 | | $MAIL_MIME->addAttachment($filepath, $files['type'][$i], $files['name'][$i], true, 'base64', 'attachment', $message_charset); |
| 299 | | |
| | 307 | { |
| | 308 | $ctype = $files['type'][$i]; |
| | 309 | $ctype = str_replace('image/pjpeg', 'image/jpeg', $ctype); // #1484914 |
| | 310 | |
| | 311 | $MAIL_MIME->addAttachment($filepath, $ctype, $files['name'][$i], true, |
| | 312 | ($ctype == 'message/rfc822' ? $transfer_encoding : 'base64'), |
| | 313 | 'attachment', $message_charset); |
| | 314 | } |
| 300 | 315 | |
| 301 | | // chose transfer encoding |
| 302 | | $charset_7bit = array('ASCII', 'ISO-2022-JP', 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-15'); |
| 303 | | $transfer_encoding = in_array(strtoupper($message_charset), $charset_7bit) ? '7bit' : '8bit'; |
| 304 | 316 | |
| 305 | 317 | // encoding settings for mail composing |
| 306 | 318 | $MAIL_MIME->setParam(array( |