X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fread_body.php;h=ef59d7656a8afa1a2757684d7c5b291ea4da3b85;hp=5b984338c5214a2c0ec9ed58ef54d97af38e2ef4;hb=4002354021d08a99f572eb33fa009ac4cc86de4c;hpb=429f8906ba14dd45dc3dd2c6d15d74bfcebd6703 diff --git a/src/read_body.php b/src/read_body.php index 5b984338..ef59d765 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -1,10 +1,22 @@ "; + 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 " |