Altered HTML patch.
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 8 Sep 2001 01:37:56 +0000 (01:37 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 8 Sep 2001 01:37:56 +0000 (01:37 +0000)
This would be good with Philippe's code that strips out unliked HTML tags.
Change the $show_html_default option to be something like
  0 = no html (default)
  1 = safe html
  2 = any html

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

functions/mime.php

index 278c0d95f429ab9b3968ae07ed05641b45ca3599..f032ece72af7005697524e01071d5df0c14c5f67 100644 (file)
       // this if statement checks for the entity to show as the
       // primary message. To add more of them, just put them in the
       // order that is their priority.
       // this if statement checks for the entity to show as the
       // primary message. To add more of them, just put them in the
       // order that is their priority.
-      global $startMessage, $username, $key, $imapServerAddress, $imapPort;
+      global $startMessage, $username, $key, $imapServerAddress, $imapPort,
+          $show_html_default;
 
       $id = $message->header->id;
       $urlmailbox = urlencode($message->header->mailbox);
 
       $id = $message->header->id;
       $urlmailbox = urlencode($message->header->mailbox);
    
          // If there are other types that shouldn't be formatted, add
          // them here 
    
          // If there are other types that shouldn't be formatted, add
          // them here 
-         if ($body_message->header->type1 != "html") {   
+         if ($body_message->header->type1 != "html" && $show_html_default) {
             translateText($body, $wrap_at, $body_message->header->charset);
          }   
    
             translateText($body, $wrap_at, $body_message->header->charset);
          }   
    
          $body = base64_decode($body);
       }
 
          $body = base64_decode($body);
       }
 
-      if (!$show_html_default) {
-         $body = str_replace('<', '&lt;', $body);
-//         $body = str_replace('>', '&gt;', $body);
-// Both this and $body = htmlspecialchars($body); mess up inline
-//  quoting :-(  Anyway, just replacing < gets the job done.
-      }
-
       // All other encodings are returned raw.
       return $body;
    }
       // All other encodings are returned raw.
       return $body;
    }