From: fidian Date: Wed, 7 Mar 2001 18:35:48 +0000 (+0000) Subject: * If possible, replies now use the text-only version (cleans that up a bit) X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=3ae6e6292b28d55edddc49b62a895d9c47a8afb3 * If possible, replies now use the text-only version (cleans that up a bit) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1173 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/mime.php b/functions/mime.php index f5d4b258..0ebe0d95 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -479,7 +479,7 @@ // figures out what entity to display and returns the $message object // for that entity. - function findDisplayEntity ($message, $next = 'none') + function findDisplayEntity ($message, $textOnly = 1, $next = 'none') { global $show_html_default; @@ -495,6 +495,7 @@ // all be true. Show it, if the user so desires. // HTML mails this way all have entity_id of 2. 1 = text/plain if ($next != 'none' && + $textOnly == 0 && $next->header->type0 == "text" && $next->header->type1 == "html" && $next->header->entity_id == 2 && @@ -513,7 +514,8 @@ $next = 'none'; if (isset($message->entities[$i + 1])) $next = $message->entities[$i + 1]; - $entity = findDisplayEntity($message->entities[$i], $next); + $entity = findDisplayEntity($message->entities[$i], + $textOnly, $next); if ($entity != 0) return $entity; } @@ -536,7 +538,8 @@ $urlmailbox = urlencode($message->header->mailbox); // Get the right entity and redefine message to be this entity - $ent_num = findDisplayEntity ($message); + // Pass the 0 to mean that we want the 'best' viewable one + $ent_num = findDisplayEntity ($message, 0); $body_message = getEntity($message, $ent_num); if (($body_message->header->type0 == "text") || ($body_message->header->type0 == "rfc822")) { diff --git a/src/read_body.php b/src/read_body.php index 788aa858..84997f6c 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -199,6 +199,8 @@ $url_replytoallcc = urlencode($url_replytoallcc); $dateString = getLongDateString($message->header->date); + + // What do we reply to -- text only, if possible $ent_num = findDisplayEntity($message); /** TEXT STRINGS DEFINITIONS **/