From 172fd7184f386b948ece614c3657b8d5e40a4ee2 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Thu, 7 Dec 2000 05:01:27 +0000 Subject: [PATCH] fixed some problems and improved "view header" functionality git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@876 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/strings.php | 1 + src/read_body.php | 40 ++++++++++++++++++++++++++-------------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/functions/strings.php b/functions/strings.php index 459eeb70..8cacea41 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -135,6 +135,7 @@ function translateText(&$body, $wrap_at, $charset) { global $where, $what; // from searching + global $url_parser_php; if (!isset($url_parser_php)) { include "../functions/url_parser.php"; diff --git a/src/read_body.php b/src/read_body.php index 05462549..5825218a 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -23,6 +23,8 @@ 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"); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); @@ -47,25 +49,35 @@ echo "\n"; echo "
"; - echo ""; for ($i=1; $i < count($read)-1; $i++) { $line = htmlspecialchars($read[$i]); - if (eregi("^[ |\t]", $line)) { - $second = $line; - $first = ""; - } else if (eregi("^([^:|^\s]+):(.+)", $line, $regs)) { - $first = $regs[1]; - $second = $regs[2]; + if (eregi("^>", $line)) { + $second[$i] = $line; + $first[$i] = " "; + $cnum++; + } else if (eregi("^[ |\t]", $line)) { + $second[$i] = $line; + $first[$i] = ""; + } else if (eregi("^([^:]+):(.+)", $line, $regs)) { + $first[$i] = $regs[1] . ":"; + $second[$i] = $regs[2]; + $cnum++; } else { - $second = trim($line); - $first = ""; + $second[$i] = trim($line); + $first[$i] = ""; } - echo ""; + } + for ($i=0; $i < count($second); $i = $j) { + $f = $first[$i]; + $s = nl2br($second[$i]); + $j = $i + 1; + while ($first[$j] == "" && $j < count($first)) { + $s .= "    " . nl2br($second[$j]); + $j++; + } + parseEmail($s); + echo "$f$s"; } - echo "
"; - if ($first) echo "$first:"; - else echo " "; - echo "$second
"; echo "
\n"; echo ""; sqimap_mailbox_close($imapConnection); -- 2.25.1