Skip to content

Commit

Permalink
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/Zend/Mail/Header/ContentType.php
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ public static function fromString($headerLine)

if (count($values)) {
foreach ($values as $keyValuePair) {
list($key, $value) = explode('=', $keyValuePair);
list($key, $value) = explode('=', $keyValuePair, 2);
$value = trim($value, "'\" \t\n\r\0\x0B");
$header->addParameter($key, $value);
}
9 changes: 9 additions & 0 deletions tests/ZendTest/Mail/Header/ContentTypeTest.php
Original file line number Diff line number Diff line change
@@ -59,5 +59,14 @@ public function testProvidingParametersIntroducesHeaderFolding()
$this->assertContains(";\r\n charset=\"us-ascii\"", $string);
}

public function testExtractsExtraInformationFromContentType()
{
$contentTypeHeader = ContentType::fromString(
'Content-Type: multipart/alternative; boundary="Apple-Mail=_1B852F10-F9C6-463D-AADD-CD503A5428DD"'
);
$params = $contentTypeHeader->getParameters();
$this->assertEquals($params,array('boundary' => 'Apple-Mail=_1B852F10-F9C6-463D-AADD-CD503A5428DD'));
}

}

0 comments on commit 22808d1

Please sign in to comment.