From a0eed05c0be691feb3da83111ec5d1189905d38f Mon Sep 17 00:00:00 2001 From: stekkel Date: Thu, 30 May 2002 20:55:35 +0000 Subject: [PATCH] fixes for getting textOnly entities git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2917 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions/mime.php b/functions/mime.php index 202028ee..68d82a43 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -617,14 +617,14 @@ function getEntity ($message, $ent_id) { * figures out what entity to display and returns the $message object * for that entity. */ -function findDisplayEntity ($msg, $textOnly = 1, $entity = array() ) { +function findDisplayEntity ($msg, $textOnly = true, $entity = array() ) { global $show_html_default; $found = false; if ($msg) { $type = $msg->header->type0.'/'.$msg->header->type1; if ( $type == 'multipart/alternative') { - $msg = findAlternativeEntity($msg); + $msg = findAlternativeEntity($msg, $textOnly); if (count($msg->entities) == 0) { $entity[] = $msg->header->entity_id; } else { @@ -687,12 +687,12 @@ function findDisplayEntityHTML ($message) { return 0; } -function findAlternativeEntity ($message) { +function findAlternativeEntity ($message, $textOnly) { global $show_html_default; /* if we are dealing with alternative parts then we choose the best * viewable message supported by SM. */ - if ($show_html_default) { + if ($show_html_default && !$textOnly) { $alt_order = array ('text/plain','text/html'); } else { $alt_order = array ('text/plain'); -- 2.25.1