diff options
author | alecpl <alec@alec.pl> | 2011-05-09 08:32:13 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-05-09 08:32:13 +0000 |
commit | ac3ad69e941c0bcece827e148522a0b78aed25b3 (patch) | |
tree | 7cb820dced52f2222ef341f19e547f0e836eebff | |
parent | b5fb21e767ac6b8d683e253e0d201f29d675ebc9 (diff) |
- Fix possible ambiguity in folders caching (when list_mailboxes() was called the same result was returned, no matter what was the 1st and 2nd argument)
-rw-r--r-- | program/include/rcube_imap.php | 6 | ||||
-rw-r--r-- | program/steps/settings/folders.inc | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php index fbdaf34d5..ab2bc2a5e 100644 --- a/program/include/rcube_imap.php +++ b/program/include/rcube_imap.php @@ -3049,11 +3049,13 @@ class rcube_imap */ private function _list_mailboxes($root='', $name='*', $filter=null) { - $cache_key = 'mailboxes'; + $cache_key = $root.':'.$name; if (!empty($filter)) { - $cache_key .= '.'.substr((is_string($filter) ? $filter : serialize($filter)), 0, 90); + $cache_key .= ':'.(is_string($filter) ? $filter : serialize($filter)); } + $cache_key = 'mailboxes.'.md5($cache_key); + // get cached folder list $a_mboxes = $this->get_cache($cache_key); if (is_array($a_mboxes)) { diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc index c4c221fb5..bc95c7506 100644 --- a/program/steps/settings/folders.inc +++ b/program/steps/settings/folders.inc @@ -231,7 +231,7 @@ function rcube_subscription_form($attrib) } // get folders from server - $IMAP->clear_cache('mailboxes'); + $IMAP->clear_cache('/^mailboxes.*/', true); $a_unsubscribed = $IMAP->list_unsubscribed(); $a_subscribed = $IMAP->list_mailboxes(); |