From: stekkel Date: Mon, 18 Apr 2005 20:59:46 +0000 (+0000) Subject: Reset the pageindex on a new search X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=7762b03c9acf55988e70b35b4cc099030911d1a8 Reset the pageindex on a new search git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9353 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 3fc5a2b8..adf6b5ef 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -217,6 +217,12 @@ function sqm_api_mailbox_select($imapConnection,$account,$mailbox,$aConfig,$aPro } if (!isset($aConfig['search']) && isset($aCachedMailbox['SEARCH'][$iSetIndx])) { $aMailbox['SEARCH'][$iSetIndx] = $aCachedMailbox['SEARCH'][$iSetIndx]; + } else if (isset($aConfig['search']) && isset($aCachedMailbox['SEARCH'][$iSetIndx]) && + $aConfig['search'] != $aCachedMailbox['SEARCH'][$iSetIndx]) { + // reset the pageindex + $aMailbox['SEARCH'][$iSetIndx] = $aConfig['search']; + $aMailbox['OFFSET'] = 0; + $aMailbox['PAGEOFFSET'] = 1; } else { $aMailbox['SEARCH'][$iSetIndx] = (isset($aConfig['search'])) ? $aConfig['search'] : 'ALL'; }