X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fread_body.php;h=c29b9497b24a15e8c6bf237697bedea31db76e77;hb=485599c7720227664225597367495fd781c691b9;hp=cf2d331cf7f26120ac0f52260287011a9e385505;hpb=9cccb418e6a54d82f83027da9484b5b525926472;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index cf2d331c..c29b9497 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -1,8 +1,22 @@ - - if (!isset($config_php)) - include("../config/config.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 " |