X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fread_body.php;h=c29b9497b24a15e8c6bf237697bedea31db76e77;hp=01fc7db427660f2512b75a0ec9f009723b690fe6;hb=485599c7720227664225597367495fd781c691b9;hpb=be8e07f81ffa23efa581d6b7d1445fa893ada408 diff --git a/src/read_body.php b/src/read_body.php index 01fc7db4..c29b9497 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 " |