From dc197c8a7616c7e38273a343e92b84ceed273cc4 Mon Sep 17 00:00:00 2001 From: stekkel Date: Thu, 30 May 2002 20:52:08 +0000 Subject: [PATCH] prepare compose.php to reply/forward to multiple entities. if a message contains for example two plain/text entities then with this modification it is possible to insert both entities in the body. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2915 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/compose.php | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/src/compose.php b/src/compose.php index 2821e416..1445841e 100644 --- a/src/compose.php +++ b/src/compose.php @@ -390,27 +390,32 @@ function newMail () { sqimap_mailbox_select($imapConnection, $mailbox); $message = sqimap_get_message($imapConnection, $id, $mailbox); $orig_header = $message->header; + $body = ''; if ($ent_num) { - $message = getEntity($message, $ent_num); - } - if ($message->header->type0 == 'text' || - $message->header->type1 == 'message') { - if ($ent_num) { - $body = decodeBody( - mime_fetch_body($imapConnection, $id, $ent_num), - $message->header->encoding); - } else { - $body = decodeBody( - mime_fetch_body($imapConnection, $id, 1), - $message->header->encoding); - } - } else { - $body = ''; - } - - if ($message->header->type1 == 'html') { - $body = strip_tags($body); - } + $ent_ar = preg_split('/_/',$ent_num); + foreach($ent_ar as $ent_num) { + $message = getEntity($message, $ent_num); + if ($message->header->type0 == 'text' || + $message->header->type1 == 'message') { + $bodypart = decodeBody( + mime_fetch_body($imapConnection, $id, $ent_num), + $message->header->encoding); + if ($message->header->type1 == 'html') { + $bodypart = strip_tags($bodypart); + } + $body .= $bodypart; + } + } + } else if ($message->header->type0 == 'text' || + $message->header->type1 == 'message') { + $body .= decodeBody( + mime_fetch_body($imapConnection, $id, 1), + $message->header->encoding); + if ($message->header->type1 == 'html') { + $body = strip_tags($body); + } + + } sqUnWordWrap($body); -- 2.25.1