From a7ea7540551cc16c4e2f95eddbbafc131a371112 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Thu, 1 Feb 2001 20:51:52 +0000 Subject: [PATCH] removed error messages git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1031 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_mailbox.php | 14 ++++++++++++-- functions/prefs.php | 2 +- src/compose.php | 4 ++-- src/download.php | 16 +++++++--------- src/left_main.php | 4 +++- src/load_prefs.php | 2 +- src/webmail.php | 2 ++ 7 files changed, 28 insertions(+), 16 deletions(-) diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index cec646e1..6145b040 100755 --- a/functions/imap_mailbox.php +++ b/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; } diff --git a/functions/prefs.php b/functions/prefs.php index c23d3cb8..0a3f47de 100644 --- a/functions/prefs.php +++ b/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); } diff --git a/src/compose.php b/src/compose.php index 5acb8cb4..c564fcfe 100644 --- a/src/compose.php +++ b/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; diff --git a/src/download.php b/src/download.php index 04d760e3..a5b0382a 100644 --- a/src/download.php +++ b/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; diff --git a/src/left_main.php b/src/left_main.php index 718c0ffa..0077c07d 100644 --- a/src/left_main.php +++ b/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
\n"; diff --git a/src/load_prefs.php b/src/load_prefs.php index 01452b1a..0380b4de 100644 --- a/src/load_prefs.php +++ b/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; diff --git a/src/webmail.php b/src/webmail.php index 8ca5aa8e..95e2f41d 100644 --- a/src/webmail.php +++ b/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"; -- 2.25.1