Fix from Seth Randall. The range was 1 to large.
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 24 May 2004 19:46:14 +0000 (19:46 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 24 May 2004 19:46:14 +0000 (19:46 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7546 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php

index b656eef502f2a931f39e813688e5eb6d2b45e55b..433f5105cfa11f188007f680e169362dd5717482 100644 (file)
@@ -628,11 +628,11 @@ function showMessagesForMailbox($imapConnection, $aMailbox) {
                 $aFetchItems[] = 'UID';
 
                 //create id range
-                $iRangeEnd = (($aMailbox['EXISTS'] - $aMailbox['OFFSET']) > $aMailbox['LIMIT']) ?
-                                 $aMailbox['EXISTS'] - $aMailbox['OFFSET'] +1 - $aMailbox['LIMIT']:
-                                 $aMailbox['EXISTS'] - $aMailbox['OFFSET'];
-                $iRangeStart = (($aMailbox['EXISTS'] - $aMailbox['OFFSET']) > $aMailbox['LIMIT']) ?
-                                 $aMailbox['EXISTS']-$aMailbox['OFFSET'] +1:1;
+                $iRangeStart = $aMailbox['EXISTS'] - $aMailbox['OFFSET'];
+
+                $iRangeEnd   = ($iRangeStart > $aMailbox['LIMIT']) ?
+                               ($iRangeStart - $aMailbox['LIMIT']+1):1;
+
                 $id_slice = range($iRangeStart, $iRangeEnd);
                 $msgs = sqimap_get_small_header_list($imapConnection,$id_slice,$aMailbox['LIMIT'],
                      $aHeaderFields,$aFetchItems);