Skip to content

Commit

Permalink
[mms] Correctly handle content parameters in a case-insensitive manner.
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Nov 11, 2014
1 parent 91e8fe2 commit 81d8da2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion framework/Mime/lib/Horde/Mime/Headers.php
Expand Up @@ -497,7 +497,7 @@ public function getValue($header, $type = self::VALUE_STRING)
return $base;

case self::VALUE_PARAMS:
return $params;
return array_change_key_case($params, CASE_LOWER);

case self::VALUE_STRING:
foreach ($params as $key => $val) {
Expand Down
2 changes: 2 additions & 0 deletions framework/Mime/package.xml
Expand Up @@ -28,6 +28,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Correctly handle content parameters in a case-insensitive manner.
* [mms] Correctly pass the &apos;no_body&apos; parameter to parts embedded in a message/rfc822 part in Horde_Mime_Part#parseMessage().
* [mms] Fix parsing a base MIME-compliant message with no Content-Type information.
* [mms] Horde_Mime::is8bit() no longer requires the charset parameter.
Expand Down Expand Up @@ -1462,6 +1463,7 @@
<date>2014-10-28</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Correctly handle content parameters in a case-insensitive manner.
* [mms] Correctly pass the &apos;no_body&apos; parameter to parts embedded in a message/rfc822 part in Horde_Mime_Part#parseMessage().
* [mms] Fix parsing a base MIME-compliant message with no Content-Type information.
* [mms] Horde_Mime::is8bit() no longer requires the charset parameter.
Expand Down
15 changes: 15 additions & 0 deletions framework/Mime/test/Horde/Mime/HeadersTest.php
Expand Up @@ -159,6 +159,21 @@ public function testParseContentDispositionHeaderWithUtf8Data()
);
}

public function testCaseInsensitiveContentParameters()
{
$hdr = 'Content-Type: multipart/mixed; BOUNDARY="foo"';
$hdrs = Horde_Mime_Headers::parseHeaders($hdr);

$c_params = $hdrs->getValue(
'Content-Type',
$hdrs::VALUE_PARAMS
);
$this->assertEquals(
'foo',
$c_params['boundary']
);
}

public function testParseEaiAddresses()
{
/* Simple message. */
Expand Down

0 comments on commit 81d8da2

Please sign in to comment.