X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fprinter_friendly_bottom.php;h=0ff5dd9d5219ff769ad46486a2f4c6241c24a85a;hp=9f5a0978855b6a4d7f9f38dcdc04223aba52b0ab;hb=5caf2d0cef47f1057b5d4cd5f7a508d4a7692252;hpb=2b3d9db0de25bd21262bd252071977b248e0ca2a diff --git a/src/printer_friendly_bottom.php b/src/printer_friendly_bottom.php index 9f5a0978..0ff5dd9d 100644 --- a/src/printer_friendly_bottom.php +++ b/src/printer_friendly_bottom.php @@ -27,30 +27,30 @@ $mailbox = urldecode($mailbox); $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 .= '
'; } $hookResults = do_hook('message_body', $body); $body = $hookResults[1]; @@ -58,8 +58,6 @@ if ($ent_ar[0] != '') { $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 @@ if ( empty($pf_cleandisplay) || $pf_cleandisplay != 'no' ) { $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);