alecpl
2011-06-27 68070e448c6c8cd09faa75fd70ff11bfea764cc1
- Fix PHP warning in mailbox_info(),
- Set namespace/delimiter in constructor (this way some methods could be used before connecting to IMAP server)


1 files modified
23 ■■■■■ changed files
program/include/rcube_imap.php 23 ●●●●● patch | view | raw | blame | history
program/include/rcube_imap.php
@@ -121,6 +121,13 @@
    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'];
    }
@@ -549,12 +556,6 @@
    private function set_env()
    {
        if ($this->delimiter !== null && $this->namespace !== null) {
            return;
        }
        if (isset($_SESSION['imap_namespace']) && isset($_SESSION['imap_delimiter'])) {
            $this->namespace = $_SESSION['imap_namespace'];
            $this->delimiter = $_SESSION['imap_delimiter'];
            return;
        }
@@ -3505,10 +3506,12 @@
        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;
                        }
                    }
                }
            }