Dont utf7_decode translated INBOX name, which is html encoded
[squirrelmail.git] / functions / imap_messages.php
index bc3561d118ff0a2183b0835b1c1a004af9f27236..cbfd233b512e341a48762b4c524cfe85cf4ce4dd 100755 (executable)
@@ -3,7 +3,7 @@
 /**
  * imap_messages.php
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 1999-2004 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * This implements functions that manipulate messages
@@ -63,10 +63,11 @@ function sqimap_msgs_list_move ($imap_stream, $id, $mailbox) {
  * @param string $mailbox Mailbox messages are being deleted from
  * @return void
  */
-function sqimap_messages_delete ($imap_stream, $start, $end, $mailbox) {
+function sqimap_messages_delete ($imap_stream, $start, $end, $mailbox, $bypass_trash=false) {
     global $move_to_trash, $trash_folder, $auto_expunge, $uid_support;
 
-    if (($move_to_trash == true) && (sqimap_mailbox_exists($imap_stream, $trash_folder) && ($mailbox != $trash_folder))) {
+    if (($move_to_trash == true) && ($bypass_trash != true) &&
+        (sqimap_mailbox_exists($imap_stream, $trash_folder) && ($mailbox != $trash_folder))) {
         sqimap_messages_copy ($imap_stream, $start, $end, $trash_folder);
     }
     sqimap_messages_flag ($imap_stream, $start, $end, "Deleted", true);
@@ -75,7 +76,8 @@ function sqimap_messages_delete ($imap_stream, $start, $end, $mailbox) {
 function sqimap_msgs_list_delete ($imap_stream, $mailbox, $id, $bypass_trash=false) {
     global $move_to_trash, $trash_folder, $uid_support;
     $msgs_id = sqimap_message_list_squisher($id);
-    if (($move_to_trash == true) && (sqimap_mailbox_exists($imap_stream, $trash_folder) && ($mailbox != $trash_folder)) && ($bypass_trash != true)) {
+    if (($move_to_trash == true) && ($bypass_trash != true) &&
+        (sqimap_mailbox_exists($imap_stream, $trash_folder) &&  ($mailbox != $trash_folder)) ) {
         $read = sqimap_run_command ($imap_stream, "COPY $msgs_id " . sqimap_encode_mailbox_name($trash_folder), true, $response, $message, $uid_support);
     }
     $read = sqimap_run_command ($imap_stream, "STORE $msgs_id +FLAGS (\\Deleted)", true, $response, $message, $uid_support);
@@ -621,7 +623,7 @@ function sqimap_get_small_header_list ($imap_stream, $msg_list, $show_num=false)
                 $header = parseString($read,$i);
                 if ($header === false) break 3;
                 /* First we unfold the header */
-                $hdr = trim(str_replace(array("\r\n\t", "\r\n "),array('', ''), $header));
+                $hdr = trim(str_replace(array("\r\n\t", "\r\n "),array(' ', ' '), $header));
                 /* Now we can make a new header array with */
                 /* each element representing a headerline  */
                 $hdr = explode("\r\n" , $hdr);