Sfoglia il codice sorgente

- Properly clean up temporary attachment files when saving as Draft
(#1358407)

Thijs Kinkhorst 19 anni fa
parent
commit
ac7e8672b0
2 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 2 0
      ChangeLog
  2. 5 0
      src/compose.php

+ 2 - 0
ChangeLog

@@ -486,6 +486,8 @@ Version 1.5.1 -- CVS
     information.
   - Support for LIST-SUBSCRIBED extension. This speeds up the retrieval of
     the subscribed mailbox-list.
+  - Properly clean up temporary attachment files when saving as Draft
+    (#1358407)
 
 Version 1.5.0 - 2 February 2004
 -------------------------------

+ 5 - 0
src/compose.php

@@ -1459,6 +1459,10 @@ function saveAttachedFiles($session) {
     sqsession_register($compose_messages , 'compose_messages');
 }
 
+/**
+ * Given a composeMessage, recursively delete all temporary files in the
+ * attachment dir for each body part of that message.
+ */
 function ClearAttachments($composeMessage) {
     if ($composeMessage->att_local_name) {
         $attached_file = $composeMessage->att_local_name;
@@ -1642,6 +1646,7 @@ function deliverMessage($composeMessage, $draft=false) {
             sqimap_append_done ($imap_stream, $draft_folder);
             sqimap_logout($imap_stream);
             unset ($imap_deliver);
+            ClearAttachments($composeMessage);
             return $length;
         } else {
             $msg  = '<br />'.sprintf(_("Error: Draft folder %s does not exist."), $draft_folder);