From: jmunro Date: Tue, 16 Apr 2002 05:45:16 +0000 (+0000) Subject: fix E_ALL warnings when server/thread sorting not supported X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2728fa19c1b80edb4afe9a265121ce07dad56995;p=squirrelmail.git fix E_ALL warnings when server/thread sorting not supported git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2728 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 3ff46d92..277d99b0 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -130,8 +130,10 @@ function sqimap_get_sort_order ($imap_stream, $sort) { fputs($imap_stream, $sort_query); $sort_test = sqimap_read_data($imap_stream, $sid, false, $response, $message); } - if (preg_match("/^\* SORT (.+)$/", $sort_test[0], $regs)) { - $server_sort_array = preg_split("/ /", trim($regs[1])); + if (isset($sort_test[0])) { + if (preg_match("/^\* SORT (.+)$/", $sort_test[0], $regs)) { + $server_sort_array = preg_split("/ /", trim($regs[1])); + } } if ($sort == 0 || $sort == 2 || $sort == 4) { $server_sort_array = array_reverse($server_sort_array); @@ -256,8 +258,10 @@ function get_thread_sort ($imap_stream) { $thread_query = "$sid THREAD $sort_type ".strtoupper($default_charset)." ALL\r\n"; fputs($imap_stream, $thread_query); $thread_test = sqimap_read_data($imap_stream, $sid, false, $response, $message); - if (preg_match("/^\* THREAD (.+)$/", $thread_test[0], $regs)) { - $thread_list = trim($regs[1]); + if (isset($thread_test[0])) { + if (preg_match("/^\* THREAD (.+)$/", $thread_test[0], $regs)) { + $thread_list = trim($regs[1]); + } } else { $thread_list = ""; diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 0c984df5..5458024c 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -161,8 +161,10 @@ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, case 4: /* subject */ echo " $bold"; if ($thread_sort_messages == 1) { - echo str_repeat("    ",$indent_array[$msg["ID"]]); - } + if (isset($indent_array[$msg["ID"]])) { + echo str_repeat("    ",$indent_array[$msg["ID"]]); + } + } echo "