Переглянути джерело

Altered HTML patch.

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
Tyler Akins 24 роки тому
батько
коміт
852b2577b5
1 змінених файлів з 3 додано та 9 видалено
  1. 3 9
      functions/mime.php

+ 3 - 9
functions/mime.php

@@ -535,7 +535,8 @@
       // 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);
@@ -552,7 +553,7 @@
    
          // 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);
          }   
    
@@ -690,13 +691,6 @@
          $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;
    }