r28283 - in /branches/1.6/felamimail/inc: class.bofelamimail.inc.php class.uidisplay.inc.php

View: New views
1 Messages — Rating Filter:   Alert me  

r28283 - in /branches/1.6/felamimail/inc: class.bofelamimail.inc.php class.uidisplay.inc.php

by leithoff :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Author: leithoff
Date: Tue Nov 10 11:27:58 2009
New Revision: 28283

URL: http://www.egroupware.org/viewvc/egroupware?rev=28283&view=rev
Log:
fixing a problem regarding the viewing of mails created by MSExchange that seem to contain invalid chars in BASE64 encoded string AND invalid encoding for UTF8

Modified:
    branches/1.6/felamimail/inc/class.bofelamimail.inc.php
    branches/1.6/felamimail/inc/class.uidisplay.inc.php

Modified: branches/1.6/felamimail/inc/class.bofelamimail.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/branches/1.6/felamimail/inc/class.bofelamimail.inc.php?rev=28283&r1=28282&r2=28283&view=diff
==============================================================================
--- branches/1.6/felamimail/inc/class.bofelamimail.inc.php (original)
+++ branches/1.6/felamimail/inc/class.bofelamimail.inc.php Tue Nov 10 11:27:58 2009
@@ -376,8 +376,8 @@
  switch ($_encoding)
  {
  case 'BASE64':
- // use imap_base64 to decode
- return imap_base64($_mimeMessage);
+ // use imap_base64 to decode, not any longer, as it is strict, and fails if it encounters invalid chars
+ return base64_decode($_mimeMessage); //imap_base64($_mimeMessage);
  break;
  case 'QUOTED-PRINTABLE':
  // use imap_qprint to decode

Modified: branches/1.6/felamimail/inc/class.uidisplay.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/branches/1.6/felamimail/inc/class.uidisplay.inc.php?rev=28283&r1=28282&r2=28283&view=diff
==============================================================================
--- branches/1.6/felamimail/inc/class.uidisplay.inc.php (original)
+++ branches/1.6/felamimail/inc/class.uidisplay.inc.php Tue Nov 10 11:27:58 2009
@@ -1038,9 +1038,11 @@
 
  if($singleBodyPart['mimeType'] == 'text/plain')
  {
- $newBody = $singleBodyPart['body'];
+ //$newBody = $singleBodyPart['body'];
 
  $newBody = @htmlentities($singleBodyPart['body'],ENT_QUOTES, strtoupper($this->displayCharset));
+ // if empty and charset is utf8 try sanitizing the string in question
+ if (empty($newBody) && strtolower($singleBodyPart['charSet'])=='utf-8') $newBody = @htmlentities(iconv('utf-8', 'utf-8', $singleBodyPart['body']),ENT_QUOTES, strtoupper($this->displayCharset));
  // if the conversion to htmlentities fails somehow, try without specifying the charset, which defaults to iso-
  if (empty($newBody)) $newBody    = htmlentities($singleBodyPart['body'],ENT_QUOTES);
  #$newBody = $this->bofelamimail->wordwrap($newBody, 90, "\n");


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
eGroupWare-cvs mailing list
eGroupWare-cvs@...
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs