alecpl
2010-03-12 b579f42b550a5c3f3bf11a0cee13149d67c1bcd8
program/include/rcube_imap.php
@@ -43,7 +43,6 @@
{
  var $db;
  var $conn;
  var $root_ns = '';
  var $root_dir = '';
  var $mailbox = 'INBOX';
  var $list_page = 1;
@@ -145,10 +144,7 @@
    if ($this->conn)
      {
      if (!empty($this->conn->rootdir))
        {
        $this->set_rootdir($this->conn->rootdir);
        $this->root_ns = preg_replace('/[.\/]$/', '', $this->conn->rootdir);
        }
      if (empty($this->delimiter))
   $this->get_hierarchy_delimiter();
      }
@@ -515,6 +511,9 @@
      // not very performant but more precise (using UNDELETED)
      $index = $this->_search_index($mailbox, $search_str);
      $count = is_array($index) ? count($index) : 0;
      if ($mode == 'ALL')
        $_SESSION['maxuid'][$mailbox] = $index ? $this->_id2uid(max($index)) : 0;
      }
    else {
      if ($mode == 'UNSEEN')
@@ -2676,8 +2675,12 @@
    foreach ($a as $val)
      {
      $j++;
      $address = $val['address'];
      $name = preg_replace(array('/^[\'"]/', '/[\'"]$/'), '', trim($val['name']));
      $address = trim($val['address']);
      $name = trim($val['name']);
      if (preg_match('/^[\'"]/', $name) && preg_match('/[\'"]$/', $name))
        $name = preg_replace(array('/^[\'"]/', '/[\'"]$/'), '', $name);
      if ($name && $address && $name != $address)
        $string = sprintf('%s <%s>', preg_match("/$special_chars/", $name) ? '"'.addcslashes($name, '"').'"' : $name, $address);
      else if ($address)
@@ -2688,7 +2691,7 @@
      $out[$j] = array('name' => $name,
                       'mailto' => $address,
                       'string' => $string);
      if ($max && $j==$max)
        break;
      }
@@ -2922,7 +2925,7 @@
   */
  function mod_mailbox($mbox_name, $mode='in')
    {
    if ((!empty($this->root_ns) && $this->root_ns == $mbox_name) || $mbox_name == 'INBOX')
    if ($mbox_name == 'INBOX')
      return $mbox_name;
    if (!empty($this->root_dir)) {