From d4538b2520e1896397204c1b35e3b02ed2f99ebc Mon Sep 17 00:00:00 2001 From: stekkel Date: Tue, 17 Dec 2002 18:19:52 +0000 Subject: [PATCH] make printer friendly view work with rfc822 attachments git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4277 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/printer_friendly_bottom.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/printer_friendly_bottom.php b/src/printer_friendly_bottom.php index b0f91071..2d4acfd5 100644 --- a/src/printer_friendly_bottom.php +++ b/src/printer_friendly_bottom.php @@ -33,18 +33,26 @@ $onetimepad = $_SESSION['onetimepad']; $passed_id = (int) $_GET['passed_id']; $mailbox = $_GET['mailbox']; + +if (!isset($_GET['passed_ent_id'])) { + $passed_ent_id = ''; +} else { + $passed_ent_id = $_GET['passed_ent_id']; +} /* end globals */ $pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay'); $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); +$mbx_response = sqimap_mailbox_select($imapConnection, $mailbox); +if (isset($messages[$mbx_response['UIDVALIDITY']][$passed_id])) { + $message = &$messages[$mbx_response['UIDVALIDITY']][$passed_id]; +} else { + $message = sqimap_get_message($imapConnection, $passed_id, $mailbox); +} +if ($passed_ent_id) { + $message = &$message->getEntity($passed_ent_id); } - /* --start display setup-- */ -- 2.25.1