X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fmessage_details%2Fmessage_details_bottom.php;h=0852e5ca8c61ff3678081b0822141cfa716b12b0;hp=b89767798d6f72deb7997136619dadf59f2ca8a7;hb=2c92ea9da4c11cac1ea3118a1e0fda6407e5d62b;hpb=6c84ba1ec45ab854c37b6f65c5b4d84ab1c7aad4 diff --git a/plugins/message_details/message_details_bottom.php b/plugins/message_details/message_details_bottom.php index b8976779..0852e5ca 100644 --- a/plugins/message_details/message_details_bottom.php +++ b/plugins/message_details/message_details_bottom.php @@ -1,14 +1,13 @@ {'.dechex(ord('\\1')).'}'",$string); +} /** * Calculates id of MIME entity @@ -69,6 +93,8 @@ function CalcEntity($entString, $direction) { return ($result); } + + /** * Returns time in microseconds between selected and current timestamp * @@ -82,6 +108,27 @@ function returnTime($start) { return $timepassed; } + + +/** + * Returns actual message details + * @param string $mailbox + * @param string $passed_id + * @param boolean $stripHTML If TRUE, only plain text is returned, + * default is FALSE, wherein output contains + * pretty-HTMLification of message body + * @return string The formatted message details + * @access public + */ +function get_message_details($mailbox, $passed_id, $stripHTML=FALSE) { + +global $imapServerAddress, $imapPort, $color,$msgd_8bit_in_hex; + +$returnValue = ''; + +sqgetGlobalVar('username', $username, SQ_SESSION); +sqgetGlobalVar('key', $key, SQ_COOKIE); + $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); $read = sqimap_mailbox_select($imapConnection, $mailbox); $start = gettimeofday(); @@ -255,13 +302,19 @@ for ($i=1; $i < $count; $i++) { } } */ - $line = htmlspecialchars($line); - $message_body .= "$pre"."$line"."$end".'
'."\r\n"; + if ($stripHTML) { + $message_body .= $line . "\r\n"; + } else { + $line = htmlspecialchars($line); + if ($msgd_8bit_in_hex) $line = msgd_convert_to_hex($line); + $message_body .= "$pre"."$line"."$end".'
'."\r\n"; + } } -//echo returnTime($start).'
'; + +//$returnValue .= returnTime($start).'
'; $xtra = << +