X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=e4ee9458c33815ce9d25dd46b0cd69ac01890845;hb=10f0ce7221de24677e1d3443d0a57df50a4ae805;hp=dc0d9952ab8a8861e161b3d2bd03d8112bc2c5a4;hpb=9f2215a1f40978a370a7538229ca2f55f55026ee;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index dc0d9952..e4ee9458 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -1,183 +1,649 @@ "; - echo "
\n"; - displayPageHeader($color, $mailbox); - - /** translate the subject and mailbox into url-able text **/ - $url_subj = urlencode(trim(stripslashes($message["HEADER"]["SUBJECT"]))); - $urlMailbox = urlencode($mailbox); - $url_replyto = urlencode($message["HEADER"]["REPLYTO"]); - - $url_replytoall = urlencode($message["HEADER"]["REPLYTO"]); - $url_replytoallcc = urlencode(getLineOfAddrs($message["HEADER"]["TO"]) . ", " . getLineOfAddrs($message["HEADER"]["CC"])); - - $dateString = getLongDateString($message["HEADER"]["DATE"]); - - /** TEXT STRINGS DEFINITIONS **/ - $echo_more = _("more"); - $echo_less = _("less"); - - /** FORMAT THE TO STRING **/ - $i = 0; - $to_string = ""; - $to_ary = $message["HEADER"]["TO"]; - while ($i < count($to_ary)) { - $to_ary[$i] = htmlspecialchars($to_ary[$i]); - if ($to_string) - $to_string = "$to_string";
- echo "
| ||||||||||
";
- echo "
| ||||||||||
\n";
- $body = formatBody($message, $color, $wrap_at);
- echo " "; - - echo "$body"; - - echo " | ||||||||||
';
+
+ $cnum = 0;
+ for ($i=1; $i < count($read); $i++) {
+ $line = htmlspecialchars($read[$i]);
+ 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[$i] = trim($line);
+ $first[$i] = '';
+ }
+ }
+ for ($i=0; $i < count($second); $i = $j) {
+ 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]);
+ $j++;
+ }
+ parseEmail($s);
+ if (isset($f)) echo " |