Attachments now opened with binary flag, for windows compatibility
authoritsbruce <itsbruce@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 3 Sep 2002 15:43:11 +0000 (15:43 +0000)
committeritsbruce <itsbruce@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 3 Sep 2002 15:43:11 +0000 (15:43 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3533 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php
src/draft_actions.php
src/move_messages.php
src/read_body.php
src/retrievalerror.php

index 774300fbc0145f3d1f4c27bb743ef8e25b9f0696..d130c06f2d568bd6b2b8f05589f4eecc12863550 100644 (file)
@@ -645,7 +645,7 @@ function getAttachments($message, $session, $passed_id, $entities, $imapConnecti
             $newAttachment['session'] = $session;
 
             /* Write Attachment to file */
-            $fp = fopen ("$hashed_attachment_dir/$localfilename", 'w');
+            $fp = fopen ("$hashed_attachment_dir/$localfilename", 'wb');
             fputs($fp, decodeBody(mime_fetch_body($imapConnection,
                   $passed_id, $message->entity_id),
                   $message->header->encoding));
@@ -684,7 +684,7 @@ function getMessage_RFC822_Attachment($message, $session, $passed_id,
         $localfilename = GenerateRandomString(32, 'FILE', 7);
         $full_localfilename = "$hashed_attachment_dir/$localfilename";
             
-        $fp = fopen( $full_localfilename, 'w');
+        $fp = fopen( $full_localfilename, 'wb');
         fwrite ($fp, $body);
         fclose($fp);
         $newAttachment = array();
index 4bfe3659aaffb092c654bdea70b11b54f2260ed3..1bb549ad299630da98d68be4e47c2bc5489f6a4d 100644 (file)
@@ -162,7 +162,7 @@ function saveMessageAsDraft($t, $c, $b, $subject, $body, $reply_id, $prio = 3, $
          $tmpDraftFile = "draft-" . GenerateRandomString(32, '', 7);
          $full_tmpDraftFile = "$hashed_attachment_dir/$tmpDraftFile";
     }
-    $fp = fopen($full_tmpDraftFile, 'w');
+    $fp = fopen($full_tmpDraftFile, 'wb');
 
     $headerlength = write822HeaderForDraft
         ($fp, $t, $c, $b, $subject, $more_headers, $session);
@@ -188,4 +188,4 @@ function saveMessageAsDraft($t, $c, $b, $subject, $body, $reply_id, $prio = 3, $
     return $length;
 }
 
-?>
\ No newline at end of file
+?>
index 027fbc0cee232e01234e647a29190ca11029481c..121a18cc876d0e13fa9c297bd60694c38e96676c 100644 (file)
@@ -96,7 +96,7 @@ function attachSelectedMessages($msg, $imapConnection) {
                $localfilename = GenerateRandomString(32, 'FILE', 7);
                $full_localfilename = "$hashed_attachment_dir/$localfilename";
                
-               $fp = fopen( $full_localfilename, 'w');
+               $fp = fopen( $full_localfilename, 'wb');
                fwrite ($fp, $body);
                fclose($fp);
                $newAttachment = array();
index 1139ea45df2ba8d029c3511c841dae417c6c2ec5..cafc9c56aa1f6f8c68cc7ad33a05b8d47b32de2a 100644 (file)
@@ -206,7 +206,7 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message) {
     $localfilename = GenerateRandomString(32, 'FILE', 7);
     $full_localfilename = "$hashed_attachment_dir/$localfilename";
 
-    $fp = fopen( $full_localfilename, 'w');
+    $fp = fopen( $full_localfilename, 'wb');
     fwrite ($fp, $part2);
     fclose($fp);
 
index e95657a63b780aea8ce152eff36194f16cff55a4..9f9bbacedfc2e7aaaf9eccf694ddfa0c07ff59fe 100644 (file)
@@ -55,7 +55,7 @@ while (file_exists($full_localfilename)) {
 }
 
 /* Write Attachment to file */
-$fp = fopen ($full_localfilename, 'w');
+$fp = fopen ($full_localfilename, 'wb');
 fputs ($fp, $thebastard);
 fclose ($fp);