浏览代码

Fixing #550595, start_msg needs to be readjusted if all messages on the
last page were deleted. Thanks to Cor Bosman.

Thijs Kinkhorst 23 年之前
父节点
当前提交
e2ac6bb234
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      functions/mailbox_display.php

+ 11 - 0
functions/mailbox_display.php

@@ -231,6 +231,17 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs,
     $auto_expunge, $thread_sort_messages, $allow_server_sort,
     $auto_expunge, $thread_sort_messages, $allow_server_sort,
     $data_dir, $username, $server_sort_order;
     $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
   /* This code and the next if() block check for
    * server-side sorting methods. The $id array is
    * server-side sorting methods. The $id array is
    * formatted and $sort is set to 6 to disable 
    * formatted and $sort is set to 6 to disable