X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fread_body.php;h=f0c2c6ae63abdf4cd43120d08d9115c050d9a678;hb=e788294eb201e85116fb8cb9d79a09c1a856ecba;hp=4c9f5c312cb984f7c625c77095b55b592aa2361e;hpb=e146912692c921160f93dcb6da97dc6246bf95d2;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index 4c9f5c31..f0c2c6ae 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -1,8 +1,22 @@ - - if (!isset($config_php)) - include("../config/config.php"); +"; + 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 " |