diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-06-27 07:09:15 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-06-27 07:09:15 +0000 |
| commit | ef8a1627a6dddc703e65cbe05f0c5eda5b1159cf (patch) | |
| tree | 9ab5669196ab1624c92f724fdc841efed312d94f /roundcubemail/program | |
| parent | 8e287248b8d427a09f8955648bbe3451f97ea022 (diff) | |
- Fix PHP warning in mailbox_info(),
- Set namespace/delimiter in constructor (this way some methods could be used before connecting to IMAP server)
git-svn-id: https://svn.roundcube.net/trunk@4879 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
| -rw-r--r-- | roundcubemail/program/include/rcube_imap.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php index e1da538da..c2a4a0dc2 100644 --- a/roundcubemail/program/include/rcube_imap.php +++ b/roundcubemail/program/include/rcube_imap.php @@ -121,6 +121,13 @@ class rcube_imap function __construct() { $this->conn = new rcube_imap_generic(); + + // Set namespace and delimiter from session, + // so some methods would work before connection + if (isset($_SESSION['imap_namespace'])) + $this->namespace = $_SESSION['imap_namespace']; + if (isset($_SESSION['imap_delimiter'])) + $this->delimiter = $_SESSION['imap_delimiter']; } @@ -552,12 +559,6 @@ class rcube_imap return; } - if (isset($_SESSION['imap_namespace']) && isset($_SESSION['imap_delimiter'])) { - $this->namespace = $_SESSION['imap_namespace']; - $this->delimiter = $_SESSION['imap_delimiter']; - return; - } - $config = rcmail::get_instance()->config; $imap_personal = $config->get('imap_ns_personal'); $imap_other = $config->get('imap_ns_other'); @@ -3505,10 +3506,12 @@ class rcube_imap if (!empty($namespace)) { $mbox = $mailbox . $this->delimiter; foreach ($namespace as $ns) { - foreach ($ns as $item) { - if ($item[0] === $mbox) { - $options['is_root'] = true; - break; + if (!empty($ns)) { + foreach ($ns as $item) { + if ($item[0] === $mbox) { + $options['is_root'] = true; + break; + } } } } |
