ehh, hmm: include -> require
[squirrelmail.git] / functions / mime.php
index b165bd2881d2940cdca88502980ba37556fd8cce..4cc1ccaa11c9c72c3b3dc8a9b9b7b9f3eae4b65b 100644 (file)
@@ -376,7 +376,7 @@ function mime_fetch_body ($imap_stream, $id, $ent_id ) {
     // that it is the first one.  That is usually the case anyway.
     if (!$ent_id)
         $ent_id = 1;
-    $data = sqimap_run_command ($imap_stream, " FETCH $id BODY[$ent_id]", true, $response, $message);
+    $data = sqimap_run_command ($imap_stream, "FETCH $id BODY[$ent_id]", true, $response, $message);
     $topline = array_shift($data);
     while (! ereg('\\* [0-9]+ FETCH ', $topline) && $data)
         $topline = array_shift($data);
@@ -411,6 +411,7 @@ function mime_fetch_body ($imap_stream, $id, $ent_id ) {
                 $k++;
             }
             if ( $base <> '' )
+                
                 $ret = "<base href=\"$base\">" . $ret;
         }
     } else if (ereg('"([^"]*)"', $topline, $regs)) {
@@ -835,8 +836,11 @@ function encodeHeader ($string) {
 */
 function MagicHTML( $body, $id ) {
 
-    global $message, $PHP_SELF, $HTTP_SERVER_VARS;
+    global $message, $HTTP_SERVER_VARS, 
+           $attachment_common_show_images;
 
+    $attachment_common_show_images =
+                     FALSE; // Don't display attached images in HTML mode
     $j = strlen( $body );   // Legnth of the HTML
     $ret = '';              // Returned string
     $bgcolor = '#ffffff';   // Background style color (defaults to white)
@@ -1023,7 +1027,7 @@ function MagicHTML( $body, $id ) {
 return( "\n\n<!-- HTML Output ahead -->\n" .
         $ret .
         "\n<!-- END of HTML Output --><base href=\"".
-        $HTTP_SERVER_VARS["SERVER_NAME"] . substr( $PHP_SELF, 0, strlen( $PHP_SELF ) - 13 ) .
+        get_location() . '/'.
         "\">\n\n" );
 }