From 4fe99bb3f939a8036ed62e74227311744247bb85 Mon Sep 17 00:00:00 2001 From: stekkel Date: Sat, 28 Jun 2003 21:05:32 +0000 Subject: [PATCH] extra check for filename/name to achieve we do not show text/plain 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/class/mime/Message.class.php b/class/mime/Message.class.php index f346ed43..ca6b8dc4 100644 --- a/class/mime/Message.class.php +++ b/class/mime/Message.class.php @@ -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') && -- 2.25.1