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]);
$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) {
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;
}
/** 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);
}
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";
$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;
// 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";
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;
}
} 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;
$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")
$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";
$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;
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";