Content-Type case sensitive

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
stefan
Posts: 1
Joined: 08 Nov 2012, 12:58

Content-Type case sensitive

Post by stefan »

KMail (Version 1.13.5) sets Content-Type to Text/Plain; charset="utf-8" (T and P uppercase)

In this case EmailReporting does not recognize the mail body.

You can use this patch to make it work:
@@ -210,7 +210,7 @@
return;
}

- if ( 'text' === $this->_ctype['primary'] && 'plain' === $this->_ctype['secondary'] )
+ if ( 'text' === strtolower($this->_ctype['primary']) && 'plain' === strtolower($this->_ctype['secondary']) )
{
$this->_body = $body;
}
@@ -245,7 +245,7 @@
$parts[ $i ]->ctype_secondary !== $parts[ $i+1 ]->ctype_secondary
)
{
- if ( $parts[ $i ]->ctype_secondary !== 'plain' )
+ if ( strtolower($parts[ $i ]->ctype_secondary) !== 'plain' )
{
$i++;
}
Post Reply