Changed many "Call-time pass-by-reference" errors. Things should be passed
[squirrelmail.git] / functions / mime.php
index e1dd774d6501f9d867285a4e777d7f73033027b3..379bdb27757473a283a2a121a8612efb57116e4d 100644 (file)
@@ -27,7 +27,7 @@
       var $type0 = '', $type1 = '', $boundary = '', $charset = '';
       var $encoding = '', $size = 0, $to = '', $from = '', $date = '';
       var $cc = '', $bcc = '', $reply_to = '', $subject = '';
-      var $id = 0, $mailbox = '', $description = '';
+      var $id = 0, $mailbox = '', $description = '', $filename = '';
       var $entity_id = 0, $message_id = 0;
    }
    
           more objects of type message.  See documentation in mime.txt for
           a better description of how this works.
        **/   
-      var $header;
-      var $entities;
+      var $header = '';
+      var $entities = '';
       
       function addEntity ($msg) {
-         $this->entities[count($this->entities)] = $msg;
+         $this->entities[] = $msg;
       }
    }
 
       } else {
          // parse the elements
          if ($debug_mime) echo "<br><font color=0000aa><tt>$structure</tt></font><br>";
-         $msg = mime_get_element (&$structure, $msg, $ent_id);
+         $msg = mime_get_element ($structure, $msg, $ent_id);
          if ($debug_mime) echo "<br>";
       }
       return $msg;
    /** This is the first function called.  It decides if this is a multipart
        message or if it should be handled as a single entity
     **/
-   function decodeMime ($imap_stream, $header) {
+   function decodeMime ($imap_stream, &$header) {
       global $username, $key, $imapServerAddress, $imapPort;
       return mime_structure ($imap_stream, $header);
    }
    
          /** Display the ATTACHMENTS: message if there's more than one part **/
          $body .= "</TD></TR></TABLE>";
-         if (isset($message->entities)) {
+         if (isset($message->entities[0])) {
             $body .= formatAttachments ($message, $ent_num, $message->header->mailbox, $id);
          }
       } else {
    function formatAttachments ($message, $ent_id, $mailbox, $id) {
       global $where, $what;
       global $startMessage, $color;
-      static $ShownHTML;
+      static $ShownHTML = 0;
       
+         $body = "";
       if ($ShownHTML == 0)
       {
             $ShownHTML = 1;