From 7762b03c9acf55988e70b35b4cc099030911d1a8 Mon Sep 17 00:00:00 2001 From: stekkel Date: Mon, 18 Apr 2005 20:59:46 +0000 Subject: [PATCH] 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 --- functions/mailbox_display.php | 6 ++++++ 1 file changed, 6 insertions(+) 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'; } -- 2.25.1