From: lkehresman Date: Tue, 19 Sep 2000 21:46:22 +0000 (+0000) Subject: added CHARSET option to searching.. should fix the german character X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=a3432f47a2e79a1619e820de4d05ec58b05b1b30 added CHARSET option to searching.. should fix the german character problem. Please test it out. It takes the charset from your current language. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@748 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/imap_general.php b/functions/imap_general.php index a9682dae..0d883966 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -13,18 +13,21 @@ function sqimap_read_data ($imap_stream, $pre, $handle_errors, $response, $message) { global $color; + //$imap_general_debug = true; + $imap_general_debug = false; + $read = fgets ($imap_stream, 1024); -// echo "$read
"; + if ($imap_general_debug) echo "$read
"; $counter = 0; while ((substr($read, 0, strlen("$pre OK")) != "$pre OK") && (substr($read, 0, strlen("$pre BAD")) != "$pre BAD") && (substr($read, 0, strlen("$pre NO")) != "$pre NO")) { $data[$counter] = $read; $read = fgets ($imap_stream, 1024); -// echo "$read
"; + if ($imap_general_debug) echo "$read
"; $counter++; } -// echo "--
"; + if ($imap_general_debug) echo "--
"; if (substr($read, 0, strlen("$pre OK")) == "$pre OK") { $response = "OK"; $message = trim(substr($read, strlen("$pre OK"), strlen($read))); diff --git a/functions/imap_search.php b/functions/imap_search.php index 1b42a98d..667c795a 100644 --- a/functions/imap_search.php +++ b/functions/imap_search.php @@ -16,12 +16,16 @@ $imap_search_php = true; function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$color) { - global $msgs, $message_highlight_list; + global $msgs, $message_highlight_list, $squirrelmail_language, $languages; $urlMailbox = urlencode($mailbox); # Construct the Search QuERY - $ss = "a001 SEARCH ALL $search_where \"$search_what\"\r\n"; + if ($languages[$squirrelmail_language]["CHARSET"]) { + $ss = "a001 SEARCH CHARSET ".$languages[$squirrelmail_language]["CHARSET"]." ALL $search_where \"$search_what\"\r\n"; + } else { + $ss = "a001 SEARCH ALL $search_where \"$search_what\"\r\n"; + } fputs($imapConnection,$ss); # Read Data Back From IMAP diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 87074a06..e4d3c681 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -66,6 +66,12 @@ global $msgs, $msort; global $sent_folder; global $message_highlight_list; + global $auto_expunge; + + if ($auto_expunge) { + sqimap_mailbox_expunge($imapConnection, $mailbox); + sqimap_mailbox_select($imapConnection, $mailbox); + } if (!$use_cache) { if ($numMessages >= 1) { diff --git a/src/left_main.php b/src/left_main.php index 39382ea0..aff30830 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -40,7 +40,6 @@ displayHtmlHeader(); - function formatMailboxName($imapConnection, $mailbox, $real_box, $delimeter, $unseen) { global $folder_prefix, $trash_folder, $sent_folder; global $color, $move_to_sent, $move_to_trash; @@ -142,6 +141,9 @@ $line .= replace_spaces(readShortMailboxName($mailbox, $delimeter)); $line .= ""; } else { + if ($auto_expunge) { + sqimap_mailbox_expunge($imapConnection, $boxes[$i]["unformatted-dm"]); + } $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]); } } else { diff --git a/src/search.php b/src/search.php index 1db642f1..f5b4798d 100644 --- a/src/search.php +++ b/src/search.php @@ -10,6 +10,8 @@ exit; } + if (!isset($i18n_php)) + include("../functions/i18n.php"); if (!isset($config_php)) include("../config/config.php"); if (!isset($strings_php))