diff options
author | thomascube <thomas@roundcube.net> | 2007-10-17 21:27:20 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2007-10-17 21:27:20 +0000 |
commit | 57456485c477d2f493b4ecd69a3608fe1ad2dcbf (patch) | |
tree | 2ab15d1dd98b32f7645f99a40a473fc9880345bc /program/include/rcube_imap.inc | |
parent | fc67251839ae210a138cafc68fdb7f5aae95a151 (diff) |
Only change subscriptions when renaming succeeds; also quote slashes
Diffstat (limited to 'program/include/rcube_imap.inc')
-rw-r--r-- | program/include/rcube_imap.inc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc index 8bcce8a94..a5258279c 100644 --- a/program/include/rcube_imap.inc +++ b/program/include/rcube_imap.inc @@ -35,7 +35,7 @@ require_once('lib/mime.inc'); * * @package Mail * @author Thomas Bruederli <roundcube@gmail.com> - * @version 1.36 + * @version 1.39 * @link http://ilohamail.org */ class rcube_imap @@ -1703,17 +1703,19 @@ class rcube_imap if (strlen($abs_name)) $result = iil_C_RenameFolder($this->conn, $mailbox, $abs_name); - // check if mailbox children are subscribed - foreach ($a_subscribed as $c_subscribed) - if (preg_match('/^'.preg_quote($mailbox.$this->delimiter).'/', $c_subscribed)) - { - iil_C_UnSubscribe($this->conn, $c_subscribed); - iil_C_Subscribe($this->conn, preg_replace('/^'.preg_quote($mailbox).'/', $abs_name, $c_subscribed)); - } - - // clear cache if ($result) { + $delm = $this->get_hierarchy_delimiter(); + + // check if mailbox children are subscribed + foreach ($a_subscribed as $c_subscribed) + if (preg_match('/^'.preg_quote($mailbox.$delm, '/').'/', $c_subscribed)) + { + iil_C_UnSubscribe($this->conn, $c_subscribed); + iil_C_Subscribe($this->conn, preg_replace('/^'.preg_quote($mailbox, '/').'/', $abs_name, $c_subscribed)); + } + + // clear cache $this->clear_message_cache($mailbox.'.msg'); $this->clear_cache('mailboxes'); } |