Skip to content
Browse files

Fix boundaries used in multi-part messages.

Inline attachments should use the multipart/related boundary.  Otherwise
sections will be incorrectly nested.

Fixes #2413
  • Loading branch information...
1 parent 29cfdb4 commit 4d73f4e6a10295de447c64c26bd951ac2a3b450d @markstory markstory committed
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/Cake/Network/Email/CakeEmail.php
  2. +1 −1 lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
View
2 lib/Cake/Network/Email/CakeEmail.php
@@ -1323,7 +1323,7 @@ protected function _render($content) {
$msg[] = '--' . $boundary;
$msg[] = 'Content-Type: multipart/related; boundary="rel-' . $boundary . '"';
$msg[] = '';
- $relBoundary = 'rel-' . $boundary;
+ $relBoundary = $textBoundary = 'rel-' . $boundary;
}
if ($hasMultipleTypes) {
View
2 lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
@@ -865,7 +865,7 @@ public function testSendWithInlineAttachments() {
"\r\n" .
"--alt-{$boundary}--\r\n" .
"\r\n" .
- "--$boundary\r\n" .
+ "--rel-$boundary\r\n" .
"Content-Type: application/octet-stream\r\n" .
"Content-Transfer-Encoding: base64\r\n" .
"Content-ID: <abc123>\r\n" .

0 comments on commit 4d73f4e

Please sign in to comment.
Something went wrong with that request. Please try again.