Source for file view_text.php
Documentation is available at view_text.php
* view_text.php -- View a text attachment
* Used by attachment_common code.
* @copyright 1999-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: view_text.php 14845 2020-01-07 08:09:34Z pdontthink $
/** This is the view_text page */
define('PAGE_NAME', 'view_text');
/** SquirrelMail required files. */
include('../include/init.php');
include(SM_PATH .
'functions/imap_general.php');
include(SM_PATH .
'functions/imap_messages.php');
include(SM_PATH .
'functions/mime.php');
include(SM_PATH .
'functions/date.php');
include(SM_PATH .
'functions/url_parser.php');
global $imap_stream_options; // in case not defined in config
$imapConnection =
sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imap_stream_options);
$message =
&$messages[$mbx_response['UIDVALIDITY']][$passed_id];
$message =
&$message->getEntity($passed_ent_id);
$header =
$message_ent->header;
$charset =
$header->getParameter('charset');
$msg_url =
'read_body.php?' .
$QUERY_STRING;
$dwnld_url =
'../src/download.php?' .
$QUERY_STRING .
'&absolute_dl=true';
$unsafe_url =
'view_text.php?' .
$QUERY_STRING;
$unsafe_url =
set_url_var($unsafe_url, 'view_unsafe_images', 1);
if (isset
($languages[$squirrelmail_language]['XTRA_CODE']) &&
function_exists($languages[$squirrelmail_language]['XTRA_CODE'].
'_decode')) {
$body =
call_user_func($languages[$squirrelmail_language]['XTRA_CODE'] .
'_decode', $body);
if ($type1 ==
'html' ||
(isset
($override_type1) &&
$override_type1 ==
'html')) {
// html attachment with character set information
$body =
MagicHTML( $body, $passed_id, $message, $mailbox);
$oTemplate->assign('view_message_href', $msg_url);
$oTemplate->assign('download_href', $dwnld_url);
$oTemplate->assign('view_unsafe_image_href', $ishtml ?
$unsafe_url :
'');
$oTemplate->assign('body', $body);
$oTemplate->display('view_text.tpl');
$oTemplate->display('footer.tpl');
Documentation generated on Mon, 13 Jan 2020 04:23:45 +0100 by phpDocumentor 1.4.3