make printer friendly view work with rfc822 attachments
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 17 Dec 2002 18:19:52 +0000 (18:19 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 17 Dec 2002 18:19:52 +0000 (18:19 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4277 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/printer_friendly_bottom.php

index b0f9107..2d4acfd 100644 (file)
@@ -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-- */