extra check for filename/name to achieve we do not show text/plain
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 28 Jun 2003 21:05:32 +0000 (21:05 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 28 Jun 2003 21:05:32 +0000 (21:05 +0000)
attachments inline in case of a missing Disposition mime-header

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5144 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/mime/Message.class.php

index f346ed4..ca6b8dc 100644 (file)
@@ -675,6 +675,8 @@ class Message {
             } else { /* Treat as multipart/mixed */
                 foreach ($this->entities as $ent) {
                     if((strtolower($ent->header->disposition->name) != 'attachment') &&
+                       (!isset($ent->header->parameters['filename'])) &&
+                       (!isset($ent->header->parameters['name'])) &&
                        (($ent->type0 != 'message') && ($ent->type1 != 'rfc822'))) {
                         $entity = $ent->findDisplayEntity($entity, $alt_order, $strict);
                         $found = true;
@@ -687,6 +689,8 @@ class Message {
             foreach ($alt_order as $alt) {
                 if( ($alt == $type) && isset($this->entity_id) ) {
                     if ((count($this->entities) == 0) && 
+                       (!isset($ent->header->parameters['filename'])) &&
+                       (!isset($ent->header->parameters['name'])) &&
                         (strtolower($this->header->disposition->name) != 'attachment')) {
                         $entity[] = $this->entity_id;
                         $found = true;
@@ -702,7 +706,6 @@ class Message {
                     $found = true;
                 }
             }
-           
         }
         if(!$strict && !$found) {
             if (($this->type0 == 'text') &&