From 4e9f35e4c75579430c17919e2887640842f2daa3 Mon Sep 17 00:00:00 2001 From: kink Date: Tue, 30 Apr 2002 14:07:00 +0000 Subject: [PATCH] Fixing #550595, start_msg needs to be readjusted if all messages on the last page were deleted. Thanks to Cor Bosman. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2780 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mailbox_display.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 566b953b..6e6692f9 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -231,6 +231,17 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, $auto_expunge, $thread_sort_messages, $allow_server_sort, $data_dir, $username, $server_sort_order; + /* if $start_msg is lower than $num_msgs, we probably deleted all messages + * in the last page. We need to re-adjust the start_msg + */ + + if($start_msg > $num_msgs) { + $start_msg -= $show_num; + if($start_msg < 1) { + $start_msg = 1; + } + } + /* This code and the next if() block check for * server-side sorting methods. The $id array is * formatted and $sort is set to 6 to disable -- 2.25.1