Skip to content

Commit

Permalink
Patch+Test for PR-2122
Browse files Browse the repository at this point in the history
  • Loading branch information
padraic committed Aug 9, 2012
1 parent e7c71b7 commit 84833ff
Show file tree
Hide file tree
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
Expand Up @@ -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);
}
Expand Down
9 changes: 9 additions & 0 deletions tests/ZendTest/Mail/Header/ContentTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 84833ff

Please sign in to comment.