X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=95368c107000c8b5b5b1acea2ff97c20768e9887;hb=541506f3bbe3cfc966221c55c35e50e9bda6f181;hp=21a6e6896e99d0a6a435d6999cda9eb4e23ab3c6;hpb=3604c641607660243271429041e78d03a9c5d268;p=squirrelmail.git
diff --git a/src/read_body.php b/src/read_body.php
index 21a6e689..95368c10 100644
--- a/src/read_body.php
+++ b/src/read_body.php
@@ -7,79 +7,72 @@
**
** This file is used for reading the msgs array and displaying
** the resulting emails in the right frame.
+ **
+ ** $Id$
**/
- session_start();
-
- if (!isset($config_php))
- include("../config/config.php");
- if (!isset($strings_php))
- include("../functions/strings.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");
+ include("../src/validate.php");
+ include('../functions/imap.php');
+ include('../functions/mime.php');
+ include('../functions/date.php');
+ include('../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 ($view_hdr) {
+ if (isset($view_hdr)) {
fputs ($imapConnection, "a003 FETCH $passed_id BODY[HEADER]\r\n");
$read = sqimap_read_data ($imapConnection, "a003", true, $a, $b);
- echo "
";
- echo "
'; + echo ' |
"; + echo ' |
';
- 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 " |