Переглянути джерело

Fixed problem that caused an error when deleting all messages on the last page of a paginated view (provides fix for #1014612). It would point to an invalid page mainly because an extra variable wasn't being updated and one other small miscalculation.

Jimmy Conner 21 роки тому
батько
коміт
9f5ced8fd0
2 змінених файлів з 4 додано та 1 видалено
  1. 2 0
      ChangeLog
  2. 2 1
      functions/mailbox_display.php

+ 2 - 0
ChangeLog

@@ -100,6 +100,8 @@ Version 1.5.1 -- CVS
   - Fixed $custom_css loading in squirrelspell plugin.
   - Turkish translation uses C character case conversion rules. Fixes php and
     squirrelmail functions are assume English conversion rules.
+  - Fixed problem that caused an error when deleting all messages on the last page
+    of a paginated view (provides fix for #1014612)
 
 Version 1.5.0
 --------------------

+ 2 - 1
functions/mailbox_display.php

@@ -1961,9 +1961,10 @@ function handleMessageListForm($imapConnection,&$aMailbox,$sButton='',$aUid = ar
                     $aMailbox['EXISTS'] -= (int) $iExpungedMessages;
                 }
                 // Change the startMessage number if the mailbox was changed
-                if (($aMailbox['PAGEOFFSET']+$iExpungedMessages-1) >= $aMailbox['EXISTS']) {
+                if (($aMailbox['PAGEOFFSET']-1) >= $aMailbox['EXISTS']) {
                     $aMailbox['PAGEOFFSET'] = ($aMailbox['PAGEOFFSET'] > $aMailbox['LIMIT']) ?
                         $aMailbox['PAGEOFFSET'] - $aMailbox['LIMIT'] : 1;
+                    $aMailbox['OFFSET'] = $aMailbox['PAGEOFFSET'] - 1 ; 
                 }
             }
         }