prepare compose.php to reply/forward to multiple entities.
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 30 May 2002 20:52:08 +0000 (20:52 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 30 May 2002 20:52:08 +0000 (20:52 +0000)
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

index 2821e41..1445841 100644 (file)
@@ -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);