/**
* printer_friendly_bottom.php
*
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* with javascript on, it is the bottom frame of printer_friendly_main.php
$username = $_SESSION['username'];
$onetimepad = $_SESSION['onetimepad'];
-$passed_ent_id = $_GET['passed_ent_id'];
-$passed_id = $_GET['passed_id'];
+$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-- */
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>';
+ $body .= '<hr noshade size="1" />';
}
$hookResults = do_hook('message_body', $body);
$body = $hookResults[1];
}
/* body */
echo html_tag( 'tr',
- html_tag( 'td', '<hr noshade size=1><br>' . "\n" . $body, 'left', '', 'colspan="2"' )
+ html_tag( 'td', '<hr noshade size="1" /><br>' . "\n" . $body, 'left', '', 'colspan="2"' )
) . "\n" .
'</table>' . "\n" .