X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=5825218a6f925c2d2fa505e5e5d91025330cde2d;hb=172fd7184f386b948ece614c3657b8d5e40a4ee2;hp=3c13148aabfb172e59a0bed10370d94714dad367;hpb=b235d62915dba943446744b725971bd2c47bc347;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index 3c13148a..5825218a 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -1,34 +1,181 @@ - - include("../config/config.php"); - include("../functions/strings.php"); - include("../functions/page_header.php"); - include("../functions/imap.php"); - include("../functions/mime.php"); - include("../functions/mailbox.php"); - include("../functions/date.php"); +"; + echo "
";
+
+ for ($i=1; $i < count($read)-1; $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) {
+ $f = $first[$i];
+ $s = nl2br($second[$i]);
+ $j = $i + 1;
+ while ($first[$j] == "" && $j < count($first)) {
+ $s .= " " . nl2br($second[$j]);
+ $j++;
+ }
+ parseEmail($s);
+ echo " |