Skip to content

Commit

Permalink
Ensure we don't send broken UTF8 data to the client.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Sep 27, 2013
1 parent 7eb78e1 commit 347bd25
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions framework/ActiveSync/lib/Horde/ActiveSync/Imap/Adapter.php
Expand Up @@ -852,10 +852,14 @@ protected function _buildMailMessage(
$eas_message->displayto = $eas_message->to;
}

// Ensure we don't send broken UTF8 data to the client. It makes clients
// angry. And we don't like angry clients.
$hdr_charset = $imap_message->getStructure()->getHeaderCharset();

// Fill in other header data
$eas_message->from = $imap_message->getFromAddress();
$eas_message->subject = $imap_message->getSubject();
$eas_message->threadtopic = $imap_message->getSubject();
$eas_message->subject = $this->_validateUtf8($imap_message->getSubject(), $hdr_charset);
$eas_message->threadtopic = $eas_message->subject;
$eas_message->datereceived = $imap_message->getDate();
$eas_message->read = $imap_message->getFlag(Horde_Imap_Client::FLAG_SEEN);
$eas_message->cc = $imap_message->getCc();
Expand Down

0 comments on commit 347bd25

Please sign in to comment.