* If possible, replies now use the text-only version (cleans that up a bit)
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 7 Mar 2001 18:35:48 +0000 (18:35 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 7 Mar 2001 18:35:48 +0000 (18:35 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1173 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mime.php
src/read_body.php

index f5d4b2583397764c275c4cc98f0e476f93f797cb..0ebe0d95e59a47b149c7442a658ba3505fe0b872 100644 (file)
 
    // figures out what entity to display and returns the $message object
    // for that entity.
 
    // 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;
       
    {
       global $show_html_default;
       
           // 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' &&
           // 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 &&
               $next->header->type0 == "text" &&
               $next->header->type1 == "html" &&
               $next->header->entity_id == 2 &&
                $next = 'none';
                if (isset($message->entities[$i + 1]))
                  $next = $message->entities[$i + 1];
                $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;
             }   
                if ($entity != 0)
                  return $entity;
             }   
       $urlmailbox = urlencode($message->header->mailbox);
 
       // Get the right entity and redefine message to be this entity
       $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")) {
       $body_message = getEntity($message, $ent_num);
       if (($body_message->header->type0 == "text") || 
           ($body_message->header->type0 == "rfc822")) {
index 788aa858fe3a98bda4a0f267fe8e879170ce2007..84997f6c63dc486bb141c080f03de8ad9b0fb8b7 100644 (file)
    $url_replytoallcc = urlencode($url_replytoallcc);
 
    $dateString = getLongDateString($message->header->date);
    $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 **/
    $ent_num = findDisplayEntity($message);
 
    /** TEXT STRINGS DEFINITIONS **/