X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=c987954b7c397e56d4d5ae6294b4991268ac86ea;hb=849bdf42ed7bd7cca68909d2b46869742dfd210e;hp=e0777db5f625cb72a169aee92d16958866e18872;hpb=23fd3c8ebf96b73c2d4d09e80c04d5031fb8fc13;p=squirrelmail.git
diff --git a/src/read_body.php b/src/read_body.php
index e0777db5..c987954b 100644
--- a/src/read_body.php
+++ b/src/read_body.php
@@ -11,77 +11,68 @@
** $Id$
**/
- session_start();
-
- if (!isset($strings_php))
- include("../functions/strings.php");
- if (!isset($config_php))
- include("../config/config.php");
- if (!isset($page_header_php))
- include("../functions/page_header.php");
- if (!isset($imap_php))
- include("../functions/imap.php");
- if (!isset($mime_php))
- include("../functions/mime.php");
- if (!isset($date_php))
- include("../functions/date.php");
- if (!isset($url_parser_php))
- include("../functions/url_parser.php");
-
- include("../src/load_prefs.php");
+ require_once('../src/validate.php');
+ require_once('../functions/imap.php');
+ require_once('../functions/mime.php');
+ require_once('../functions/date.php');
+ require_once('../functions/url_parser.php');
+
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
sqimap_mailbox_select($imapConnection, $mailbox);
- do_hook("html_top");
+ do_hook('html_top');
displayPageHeader($color, $mailbox);
if (isset($view_hdr)) {
- fputs ($imapConnection, "a003 FETCH $passed_id BODY[HEADER]\r\n");
- $read = sqimap_read_data ($imapConnection, "a003", true, $a, $b);
+ fputs ($imapConnection, sqimap_session_id() . " FETCH $passed_id BODY[HEADER]\r\n");
+ $read = sqimap_read_data ($imapConnection, sqimap_session_id(), true, $a, $b);
- echo "
";
- echo "
\n";
- echo " " . _("Viewing full header") . " - ";
- if ($where && $what) {
+ echo ' ' .
+ '\n";
- echo "\n";
- echo "";
+ echo ''._("View message") . " | \n" .
+ "\n" .
+ '';
- for ($i=1; $i < count($read)-1; $i++) {
+ $cnum = 0;
+ for ($i=1; $i < count($read); $i++) {
$line = htmlspecialchars($read[$i]);
if (eregi("^>", $line)) {
$second[$i] = $line;
- $first[$i] = " ";
+ $first[$i] = ' ';
$cnum++;
} else if (eregi("^[ |\t]", $line)) {
$second[$i] = $line;
- $first[$i] = "";
+ $first[$i] = '';
} else if (eregi("^([^:]+):(.+)", $line, $regs)) {
- $first[$i] = $regs[1] . ":";
+ $first[$i] = $regs[1] . ':';
$second[$i] = $regs[2];
$cnum++;
} else {
$second[$i] = trim($line);
- $first[$i] = "";
+ $first[$i] = '';
}
}
for ($i=0; $i < count($second); $i = $j) {
- $f = $first[$i];
- $s = nl2br($second[$i]);
+ if (isset($first[$i]))
+ $f = $first[$i];
+ if (isset($second[$i]))
+ $s = nl2br($second[$i]);
$j = $i + 1;
- while ($first[$j] == "" && $j < count($first)) {
- $s .= " " . nl2br($second[$j]);
+ while ($first[$j] == '' && $j < count($first)) {
+ $s .= ' ' . nl2br($second[$j]);
$j++;
}
parseEmail($s);
- echo "$f$s";
+ if (isset($f)) echo "$f$s";
}
echo " | \n";
- echo " |