From f95115ffa358147a23ad763d5d6efa9e9fdc93bc Mon Sep 17 00:00:00 2001 From: tokul Date: Thu, 14 Apr 2005 13:20:08 +0000 Subject: [PATCH] adding file that can be used to display html mails in iframe git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9268 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/view_html.php | 107 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 src/view_html.php diff --git a/src/view_html.php b/src/view_html.php new file mode 100644 index 00000000..305e6a1f --- /dev/null +++ b/src/view_html.php @@ -0,0 +1,107 @@ +getEntity($ent_id); +if ($passed_ent_id) { + $message = &$message->getEntity($passed_ent_id); +} +$header = $message_ent->header; +$type0 = $header->type0; +$type1 = $header->type1; +$charset = $header->getParameter('charset'); +$encoding = strtolower($header->encoding); + +$body = mime_fetch_body($imap_stream, $passed_id, $ent_id); +$body = decodeBody($body, $encoding); + +/** + * TODO: check if xtra_code is needed. +if (isset($languages[$squirrelmail_language]['XTRA_CODE']) && + function_exists($languages[$squirrelmail_language]['XTRA_CODE'].'_decode')) { + if (mb_detect_encoding($body) != 'ASCII') { + $body = call_user_func($languages[$squirrelmail_language]['XTRA_CODE'] . '_decode', $body); + } +} +*/ + +/** TODO: provide reduced version of MagicHTML() */ +$body = MagicHTML( $body, $passed_id, $message, $mailbox); + +/** TODO: charset might be part of html code. */ +header('Content-Type: text/html; charset=' . $charset); +echo $body; +?> \ No newline at end of file -- 2.25.1