From 81d790739cfa8346e86dfaa1db2349e2de1d7816 Mon Sep 17 00:00:00 2001 From: itsbruce Date: Tue, 3 Sep 2002 15:43:11 +0000 Subject: [PATCH] Attachments now opened with binary flag, for windows compatibility git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3533 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/compose.php | 4 ++-- src/draft_actions.php | 4 ++-- src/move_messages.php | 2 +- src/read_body.php | 2 +- src/retrievalerror.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/compose.php b/src/compose.php index 774300fb..d130c06f 100644 --- a/src/compose.php +++ b/src/compose.php @@ -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(); diff --git a/src/draft_actions.php b/src/draft_actions.php index 4bfe3659..1bb549ad 100644 --- a/src/draft_actions.php +++ b/src/draft_actions.php @@ -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 +?> diff --git a/src/move_messages.php b/src/move_messages.php index 027fbc0c..121a18cc 100644 --- a/src/move_messages.php +++ b/src/move_messages.php @@ -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(); diff --git a/src/read_body.php b/src/read_body.php index 1139ea45..cafc9c56 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -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); diff --git a/src/retrievalerror.php b/src/retrievalerror.php index e95657a6..9f9bbace 100644 --- a/src/retrievalerror.php +++ b/src/retrievalerror.php @@ -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); -- 2.25.1