Browse Source

Bugfix in draft folders

philippe_mingo 23 years ago
parent
commit
a4aae406e8
2 changed files with 9 additions and 8 deletions
  1. 8 8
      src/compose.php
  2. 1 0
      src/delete_message.php

+ 8 - 8
src/compose.php

@@ -39,8 +39,8 @@ if (isset($draft)) {
     if (! isset($reply_id)) {
     if (! isset($reply_id)) {
          $reply_id = 0;
          $reply_id = 0;
     }
     }
-	if (! isset($MDN)) {
-	     $MDN = 'False';
+    if (! isset($MDN)) {
+        $MDN = 'False';
     }
     }
     if (!saveMessageAsDraft($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $reply_id, $MDN)) {
     if (!saveMessageAsDraft($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $reply_id, $MDN)) {
         showInputForm();
         showInputForm();
@@ -49,10 +49,10 @@ if (isset($draft)) {
         $draft_message = _("Draft Email Saved");
         $draft_message = _("Draft Email Saved");
         /* If this is a resumed draft, then delete the original */
         /* If this is a resumed draft, then delete the original */
         if(isset($delete_draft)) {
         if(isset($delete_draft)) {
-            Header("Location: delete_message.php?mailbox=$draft_folder".
+            Header("Location: delete_message.php?mailbox=" . urlencode($draft_folder) .
                    "&message=$delete_draft&sort=$sort&startMessage=1&saved_draft=yes");
                    "&message=$delete_draft&sort=$sort&startMessage=1&saved_draft=yes");
             exit();
             exit();
-        } 
+        }
         else {
         else {
             if ($compose_new_win == '1') {
             if ($compose_new_win == '1') {
                 Header("Location: compose.php?saved_draft=yes");
                 Header("Location: compose.php?saved_draft=yes");
@@ -80,13 +80,13 @@ if (isset($send)) {
         }
         }
         /*
         /*
          * Set $default_charset to correspond with the user's selection
          * Set $default_charset to correspond with the user's selection
-         * of language interface. 
+         * of language interface.
          */
          */
         set_my_charset();
         set_my_charset();
 
 
         /*
         /*
          * This is to change all newlines to \n
          * This is to change all newlines to \n
-         * We'll change them to \r\n later (in the sendMessage function) 
+         * We'll change them to \r\n later (in the sendMessage function)
          */
          */
         $body = str_replace("\r\n", "\n", $body);
         $body = str_replace("\r\n", "\n", $body);
         $body = str_replace("\r", "\n", $body);
         $body = str_replace("\r", "\n", $body);
@@ -95,7 +95,7 @@ if (isset($send)) {
          * Rewrap $body so that no line is bigger than $editor_size
          * Rewrap $body so that no line is bigger than $editor_size
          * This should only really kick in the sqWordWrap function
          * This should only really kick in the sqWordWrap function
          * if the browser doesn't support "HARD" as the wrap type
          * if the browser doesn't support "HARD" as the wrap type
-         * Or, in Opera's case, something goes wrong. 
+         * Or, in Opera's case, something goes wrong.
          */
          */
         $body = explode("\n", $body);
         $body = explode("\n", $body);
         $newBody = '';
         $newBody = '';
@@ -127,7 +127,7 @@ if (isset($send)) {
             exit();
             exit();
         }
         }
         if ( isset($delete_draft)) {
         if ( isset($delete_draft)) {
-            Header("Location: delete_message.php?mailbox=$draft_folder".
+            Header("Location: delete_message.php?mailbox=" . urlencode( $draft_folder ).
                    "&message=$delete_draft&sort=$sort&startMessage=1&mail_sent=yes");
                    "&message=$delete_draft&sort=$sort&startMessage=1&mail_sent=yes");
             exit();
             exit();
         }
         }

+ 1 - 0
src/delete_message.php

@@ -32,6 +32,7 @@ if (!isset($mail_sent)) {
 }
 }
 
 
 $location = get_location();
 $location = get_location();
+
 if (isset($where) && isset($what)) {
 if (isset($where) && isset($what)) {
     header("Location: $location/search.php?where=" . urlencode($where) .
     header("Location: $location/search.php?where=" . urlencode($where) .
            '&what=' . urlencode($what) . '&mailbox=' . urlencode($mailbox));
            '&what=' . urlencode($what) . '&mailbox=' . urlencode($mailbox));