From: Marc G. K. <st...@us...> - 2002-07-31 16:48:00
|
Update of /cvsroot/squirrelmail/squirrelmail/src In directory usw-pr-cvs1:/tmp/cvs-serv15309 Modified Files: printer_friendly_bottom.php Log Message: Fix for incorrect header in case of message/rfc822 attachments. Thnx Wouter. Index: printer_friendly_bottom.php =================================================================== RCS file: /cvsroot/squirrelmail/squirrelmail/src/printer_friendly_bottom.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -r1.12 -r1.13 --- printer_friendly_bottom.php 30 Jul 2002 08:37:43 -0000 1.12 +++ printer_friendly_bottom.php 31 Jul 2002 16:47:55 -0000 1.13 @@ -27,30 +27,30 @@ $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); sqimap_mailbox_select($imapConnection, $mailbox); $message = sqimap_get_message($imapConnection, $passed_id, $mailbox); +$id = $passed_id; +if (isset($passed_ent_id)) { + $message = $message->getEntity($passed_ent_id); +} + /* --start display setup-- */ + /* From and Date are usually fine as they are... */ $from = decodeHeader($message->header->getAddr_s('from')); $date = getLongDateString($message->header->date); +$subject = trim(decodeHeader($message->header->subject)); /* we can clean these up if the list is too long... */ $cc = decodeHeader($message->header->getAddr_s('cc')); $to = decodeHeader($message->header->getAddr_s('to')); -//$cc = decodeHeader(getLineOfAddrs($message->header->cc)); -//$to = decodeHeader(getLineOfAddrs($message->header->to)); -/* and Body and Subject could easily stream off the page... */ -$id = $passed_id; -if (isset($passed_ent_id)) { - $message = $message->getEntity($passed_ent_id); -} $ent_ar = $message->findDisplayEntity(); -//$ent_num = $ent_ar[0]; $body = ''; if ($ent_ar[0] != '') { for ($i = 0; $i < count($ent_ar); $i++) { $body .= formatBody($imapConnection, $message, $color, $wrap_at, $ent_ar[$i], $passed_id, $mailbox); + $body .= '<hr noshade size=1>'; } $hookResults = do_hook('message_body', $body); $body = $hookResults[1]; @@ -58,8 +58,6 @@ $body = _("Message not printable"); } -$subject = trim(decodeHeader($message->header->subject)); - /* now, if they choose to, we clean up the display a bit... */ if ( empty($pf_cleandisplay) || $pf_cleandisplay != 'no' ) { @@ -71,7 +69,9 @@ $to = pf_clean_string(str_replace(',,', ',', $to), $num_leading_spaces); // the body should have no leading zeros - $body = pf_clean_string($body, 0); + // disabled because it destroys html mail + +// $body = pf_clean_string($body, 0); // clean up everything else... $subject = pf_clean_string($subject, $num_leading_spaces); |