Browse Source

Fix boundaries used in multi-part messages.

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

Fixes #2413
mark_story 14 years ago
parent
commit
4d73f4e6a1

+ 1 - 1
lib/Cake/Network/Email/CakeEmail.php

@@ -1323,7 +1323,7 @@ class CakeEmail {
 			$msg[] = '--' . $boundary;
 			$msg[] = 'Content-Type: multipart/related; boundary="rel-' . $boundary . '"';
 			$msg[] = '';
-			$relBoundary = 'rel-' . $boundary;
+			$relBoundary = $textBoundary = 'rel-' . $boundary;
 		}
 
 		if ($hasMultipleTypes) {

+ 1 - 1
lib/Cake/Test/Case/Network/Email/CakeEmailTest.php

@@ -865,7 +865,7 @@ class CakeEmailTest extends CakeTestCase {
 			"\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" .