Browse Source

removed error messages

Luke Ehresman 24 years ago
parent
commit
f457b84556
7 changed files with 28 additions and 16 deletions
  1. 12 2
      functions/imap_mailbox.php
  2. 1 1
      functions/prefs.php
  3. 2 2
      src/compose.php
  4. 7 9
      src/download.php
  5. 3 1
      src/left_main.php
  6. 1 1
      src/load_prefs.php
  7. 2 0
      src/webmail.php

+ 12 - 2
functions/imap_mailbox.php

@@ -121,7 +121,11 @@
       for ($g=0; $g < count($line); $g++) {
 
          // Store the raw IMAP reply
-         $boxes[$g]["raw"] = $line[$g];
+         if (isset($line[$g]))
+            $boxes[$g]["raw"] = $line[$g];
+         else
+            $boxes[$g]["raw"] = "";
+
 
          // Count number of delimiters ($dm) in folder name
          $mailbox = trim($line_lsub[$g]);
@@ -153,6 +157,7 @@
          $boxes[$g]["unformatted-disp"] = ereg_replace("^" . $folder_prefix, "", $mailbox);
          $boxes[$g]["id"] = $g;
 
+         if (isset($line[$g]))
          ereg("\(([^)]*)\)",$line[$g],$regs);
          $flags = trim(strtolower(str_replace("\\", "",$regs[1])));
          if ($flags) {
@@ -230,8 +235,13 @@
 
          fputs ($imap_stream, "a001 LIST \"\" \"$mbx\"\r\n");
          $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
+         if (isset($sorted_list_ary[$i]))
+            $sorted_list_ary[$i] = "";
+         if (isset($read[0]))
          $sorted_list_ary[$i] = $read[0];
-         if (find_mailbox_name($sorted_list_ary[$i]) == "INBOX")
+         else
+         $sorget_list_ary[$i] = "";
+         if (isset($sorted_list_ary[$i]) && find_mailbox_name($sorted_list_ary[$i]) == "INBOX")
             $inbox_in_list = true;
       }
                 

+ 1 - 1
functions/prefs.php

@@ -140,9 +140,9 @@
    /** Gets the signature **/
    function getSig($data_dir, $username) {
       $filename = "$data_dir$username.sig";
+      $sig = "";
       if (file_exists($filename)) {
          $file = fopen($filename, "r");
-         $sig = "";
          while (!feof($file)) {
             $sig .= fgets($file, 1024);
          }

+ 2 - 2
src/compose.php

@@ -396,7 +396,7 @@
    if (isset($subject))     $subject = trim($subject);
    if (isset($body))        $body = trim($body);
    if (isset($attachfile))  $attachfile = trim($attachfile);
-   
+
    if (!isset($mailbox) || $mailbox == "" || ($mailbox == "None"))
       $mailbox = "INBOX";
 
@@ -405,7 +405,7 @@
           $HTTP_POST_FILES['attachfile']['tmp_name'] &&
           $HTTP_POST_FILES['attachfile']['tmp_name'] != 'none')
           $AttachFailure = saveAttachedFiles();
-      if (checkInput(false) && ! isset($AttachFailure)) {
+      if (checkInput(false) && !isset($AttachFailure)) {
          $urlMailbox = urlencode (trim($mailbox));
          if (! isset($reply_id))
              $reply_id = 0;

+ 7 - 9
src/download.php

@@ -107,16 +107,14 @@
    //    is displayable (text or html), it will load them up in a text
    //    viewer (built in to squirrelmail).  Otherwise, it sets the
    //    content-type as application/octet-stream
-
-   header("Pragma: ");
-   header("Content-Description: SquirrelMail Attachment");
+   
    if (isset($absolute_dl) && $absolute_dl == "true") {
       switch($type0) {
          case "text":
             $body = mime_fetch_body($imapConnection, $passed_id, $passed_ent_id);
             $body = decodeBody($body, $header->encoding);
-            header("Content-Disposition: attachment; filename=$filename");
-            header("Content-type: application/octet-stream; name=$filename");
+            header("Content-Disposition: attachment; filename=\"$filename\"");
+            header("Content-type: application/octet-stream; name=\"$filename\"");
             set_up_language(getPref($data_dir, $username, "language"));
             if ($type1 == "plain") {
                echo _("Subject") . ": " . decodeHeader(sqStripSlashes($top_header->subject)) . "\n";
@@ -127,8 +125,8 @@
             echo trim($body);
             break;
          default:
-            header("Content-Disposition: attachment; filename=$filename");
-            header("Content-type: application/octet-stream; name=$filename");
+            header("Content-Disposition: attachment; filename=\"$filename\"");
+            header("Content-type: application/octet-stream; name=\"$filename\"");
             mime_print_body_lines ($imapConnection, $passed_id, $passed_ent_id, $header->encoding);
             break;
       }
@@ -143,8 +141,8 @@
             } else {
                 $body = mime_fetch_body($imapConnection, $passed_id, $passed_ent_id);
                 $body = decodeBody($body, $header->encoding);
-                header("Content-type: $type0/$type1; name=$filename");
-                header("Content-Disposition: attachment; filename=$filename");
+                header("Content-type: $type0/$type1; name=\"$filename\"");
+                header("Content-Disposition: attachment; filename=\"$filename\"");
                 echo $body;
             }
             break;

+ 3 - 1
src/left_main.php

@@ -138,7 +138,7 @@
       $line = "";
       $mailbox = $boxes[$i]["formatted"];
       
-      if ($boxes[$i]["flags"]) {
+      if (isset($boxes[$i]["flags"])) {
          $noselect = false;
          for ($h = 0; $h < count($boxes[$i]["flags"]); $h++) {
             if (strtolower($boxes[$i]["flags"][$h]) == "noselect")
@@ -154,6 +154,8 @@
             $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]);
          }
       } else {
+        if (!isset($boxes[$i]["unseen"])) 
+            $boxes[$i]["unseen"] = "";
          $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]);
       }
       echo "$line<BR>\n";

+ 1 - 1
src/load_prefs.php

@@ -165,7 +165,7 @@
       $index_order[$i] = $order;
       $order = getPref($data_dir, $username, "order".($i+1));
    }
-   if (!$index_order) {
+   if (!isset($index_order)) {
       $index_order[1] = 1;
       $index_order[2] = 2;
       $index_order[3] = 3;

+ 2 - 0
src/webmail.php

@@ -72,6 +72,8 @@
     This was done to create a pure HTML way of refreshing the folder list since
     we would like to use as little Javascript as possible.
 **/
+   if (!isset($right_frame)) $right_frame = "";
+
    if ($right_frame == 'right_main.php') {
       $urlMailbox = urlencode($mailbox);
       $right_frame_url = "right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage";