From: Michael M Slusarz Date: Tue, 10 Mar 2009 21:10:40 +0000 (-0600) Subject: Bug #7745: Fix cache expiration when deleting a mailbox X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4547574f667d07fc6b8166f70bd03a46066e2619;p=horde.git Bug #7745: Fix cache expiration when deleting a mailbox --- diff --git a/imp/docs/CHANGES b/imp/docs/CHANGES index 72cc65cdd..8d5ebd62e 100644 --- a/imp/docs/CHANGES +++ b/imp/docs/CHANGES @@ -62,6 +62,7 @@ v4.3.4-cvs [mms] SECURITY: Don't cache local PGP public keys retrieved from the addressbook (found by Peter Meier ). +[mms] Fix cache issues in folder tree when deleting a mailbox (Bug #7745). [mms] Fix updating POP3 indices when deleting in mailbox view (Bug #8035). [jan] If updating a calendar event fails, try to import it instead (Bug #7589). [mms] Fix [un]escaping of various URLs on message screen caused by security diff --git a/imp/lib/Imap/Tree.php b/imp/lib/Imap/Tree.php index 352a425c5..bc7911417 100644 --- a/imp/lib/Imap/Tree.php +++ b/imp/lib/Imap/Tree.php @@ -821,8 +821,8 @@ class IMP_Imap_Tree $this->isVFolder($this->_tree[$search_id]))) { if (!$vfolder_base) { $id = $search_id; - } + $parent = $this->_tree[$id]['p']; unset($this->_tree[$id]); @@ -853,6 +853,13 @@ class IMP_Imap_Tree $elt = &$this->_tree[$id]; + /* Delete the entry from the folder list cache(s). */ + foreach (array('_subscribed', '_fulllist') as $var) { + if (!is_null($this->$var)) { + $this->$var = array_values(array_diff($this->$var, array($id))); + } + } + /* Do not delete from tree if there are child elements - instead, * convert to a container element. */ if ($this->hasChildren($elt)) {