X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=788aa858fe3a98bda4a0f267fe8e879170ce2007;hb=b61ed24d8a140c29d4a1ca2d918719094963aa4f;hp=01fc7db427660f2512b75a0ec9f009723b690fe6;hpb=be8e07f81ffa23efa581d6b7d1445fa893ada408;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index 01fc7db4..788aa858 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -1,52 +1,141 @@ '; + echo '
';
+
+ $cnum = 0;
+ 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) {
+ 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 " |