From 8e4dda968abe1e0b5fddd75536cf4428224be81d Mon Sep 17 00:00:00 2001 From: SJ Date: Fri, 29 Mar 2013 09:17:19 +0100 Subject: [PATCH] nested mime parsing fixes in the gui --- webui/model/search/message.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/webui/model/search/message.php b/webui/model/search/message.php index f7f40d12..3c2ef85e 100644 --- a/webui/model/search/message.php +++ b/webui/model/search/message.php @@ -139,6 +139,7 @@ class ModelSearchMessage extends Model { $qp = $base64 = 0; $has_text_plain = 0; $rfc822 = 0; + $_1st_header = 1; $from = $to = $subject = $date = $message = ""; @@ -152,7 +153,7 @@ class ModelSearchMessage extends Model { $l .= "\n"; if(($l[0] == "\r" && $l[1] == "\n" && $is_header == 1) || ($l[0] == "\n" && $is_header == 1) ){ - $is_header = 0; + $is_header = $_1st_header = 0; if($rfc822 == 1) { $rfc822 = 0; $is_header = 1; } @@ -211,10 +212,12 @@ class ModelSearchMessage extends Model { $l = preg_replace("//", ">", $l); - if($state == "FROM"){ $from .= preg_replace("/\r|\n/", "", $l); } - if($state == "TO"){ $to .= preg_replace("/\r|\n/", "", $l); } - if($state == "SUBJECT"){ $subject .= preg_replace("/\r|\n/", "", $l); } - if($state == "DATE"){ $date .= preg_replace("/\r|\n/", "", $l); } + if($_1st_header == 1) { + if($state == "FROM"){ $from .= preg_replace("/\r|\n/", "", $l); } + if($state == "TO"){ $to .= preg_replace("/\r|\n/", "", $l); } + if($state == "SUBJECT"){ $subject .= preg_replace("/\r|\n/", "", $l); } + if($state == "DATE"){ $date .= preg_replace("/\r|\n/", "", $l); } + } } else {