/**
* view_text.php -- Displays the main frameset
*
- * Copyright (c) 1999-2002 The SquirrelMail development team
+ * Copyright (c) 1999-2003 The SquirrelMail development team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* Who knows what this file does. However PUT IT HERE DID NOT PUT
/* SquirrelMail required files. */
require_once(SM_PATH . 'include/validate.php');
+require_once(SM_PATH . 'functions/global.php');
require_once(SM_PATH . 'functions/imap.php');
require_once(SM_PATH . 'functions/mime.php');
require_once(SM_PATH . 'functions/html.php');
-
-$mailbox = urldecode($_GET['mailbox']);
-if (!isset($_GET['passed_ent_id'])) {
- $passed_ent_id = '';
-} else {
- $passed_ent_id = $_GET['passed_ent_id'];
+
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
+sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
+sqgetGlobalVar('QUERY_STRING', $QUERY_STRING, SQ_SERVER);
+sqgetGlobalVar('messages', $messages);
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
+
+if ( sqgetGlobalVar('mailbox', $temp, SQ_GET) ) {
+ $mailbox = $temp;
+}
+if ( !sqgetGlobalVar('ent_id', $ent_id, SQ_GET) ) {
+ $ent_id = '';
}
-$passed_id = $_GET['passed_id'];
-$ent_id = $_GET['ent_id'];
-$username = $_SESSION['username'];
-$key = $_COOKIE['key'];
-$delimiter = $_SESSION['delimiter'];
-$onetimepad = $_SESSION['onetimepad'];
-$QUERY_STRING = $_SERVER['QUERY_STRING'];
-sqextractGlobalVar('messages');
+if ( !sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET) ) {
+ $passed_ent_id = '';
+}
+
+
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
$mbx_response = sqimap_mailbox_select($imapConnection, $mailbox);
"</TD></TR></TABLE>".
"<TABLE WIDTH=\"98%\" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">".
"<TR><TD BGCOLOR=\"$color[4]\"><TT>";
+
+ if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
+ function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
+ if (mb_detect_encoding($body) != 'ASCII') {
+ $body = $languages[$squirrelmail_language]['XTRA_CODE']('decode', $body);
+ }
+ }
+
if ($type1 == 'html' || (isset($override_type1) && $override_type1 == 'html')) {
$body = MagicHTML( $body, $passed_id, $message, $mailbox);
} else {