Forráskód Böngészése

Change   > < to they're plain text equivalents. Now when we view text/html as plaintext it doesn't look as bad.

indiri69 23 éve
szülő
commit
08de620a70
1 módosított fájl, 8 hozzáadás és 3 törlés
  1. 8 3
      functions/mime.php

+ 8 - 3
functions/mime.php

@@ -154,7 +154,7 @@ function mime_print_body_lines ($imap_stream, $id, $ent_id, $encoding) {
     // Don't kill the connection if the browser is over a dialup
     // Don't kill the connection if the browser is over a dialup
     // and it would take over 30 seconds to download it.
     // and it would take over 30 seconds to download it.
 
 
-    // donŽ´t call set_time_limit in safe mode.
+    // don´t call set_time_limit in safe mode.
     if (!ini_get("safe_mode")) {
     if (!ini_get("safe_mode")) {
         set_time_limit(0);
         set_time_limit(0);
     }
     }
@@ -349,9 +349,14 @@ function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $ma
         // them here
         // them here
         if ($body_message->header->type1 == 'html') {
         if ($body_message->header->type1 == 'html') {
             if ( $show_html_default <> 1 ) {
             if ( $show_html_default <> 1 ) {
+                $entity_conv = array('&nbsp;' => ' ',
+                                     '&gt;'   => '>',
+                                     '&lt;'   => '<');
                 $body = strip_tags( $body );
                 $body = strip_tags( $body );
-                translateText($body, $wrap_at, 
-		  $body_message->header->getParameter['charset']);
+                $body = strtr($body, $entity_conv);
+                $body = trim($body);
+                translateText($body, $wrap_at,
+                              $body_message->header->getParameter['charset']);
             } else {
             } else {
                 $body = magicHTML( $body, $id, $message, $mailbox );
                 $body = magicHTML( $body, $id, $message, $mailbox );
             }
             }