thomascube
2007-03-23 28bfe4dc80a1431655666cfb3cec30f89e3459c7
program/include/rcube_imap.inc
@@ -580,8 +580,9 @@
      $a_msg_headers = array();
      $deleted_count = $this->_fetch_headers($mailbox, $msgs, $a_msg_headers, $cache_key);
      // delete cached messages with a higher index than $max
      $this->clear_message_cache($cache_key, $max);
      // delete cached messages with a higher index than $max+1
      // Changed $max to $max+1 to fix this bug : #1484295
      $this->clear_message_cache($cache_key, $max + 1);
      // kick child process to sync cache
@@ -2117,7 +2118,12 @@
      $j++;
      $address = $val['address'];
      $name = preg_replace(array('/^[\'"]/', '/[\'"]$/'), '', trim($val['name']));
      $string = $name!==$address ? sprintf('%s <%s>', strpos($name, ',')!==FALSE ? '"'.$name.'"' : $name, $address) : $address;
      if ($name && $address && $name != $address)
        $string = sprintf('%s <%s>', strpos($name, ',')!==FALSE ? '"'.$name.'"' : $name, $address);
      else if ($address)
        $string = $address;
      else if ($name)
        $string = $name;
      
      $out[$j] = array('name' => $name,
                       'mailto' => $address,
@@ -2266,7 +2272,7 @@
  function _mod_mailbox($mbox_name, $mode='in')
    {
    if ((!empty($this->root_ns) && $this->root_ns == $mbox_name) || $mbox_name == 'INBOX')
    if (empty($mbox_name) || (!empty($this->root_ns) && $this->root_ns == $mbox_name) || $mbox_name == 'INBOX')
      return $mbox_name;
    if (!empty($this->root_dir) && $mode=='in') 
@@ -2303,12 +2309,12 @@
  function get_id($uid, $mbox_name=NULL) 
    {
      return $this->_uid2id($uid, $mbox_name);
      return $this->_uid2id($uid, $this->_mod_mailbox($mbox_name));
    }
  
  function get_uid($id,$mbox_name=NULL)
    {
      return $this->_id2uid($id, $mbox_name);
      return $this->_id2uid($id, $this->_mod_mailbox($mbox_name));
    }
  function _uid2id($uid, $mbox_name=NULL)
@@ -2476,7 +2482,7 @@
      foreach ($sub_a as $k => $v)
        {
        if ((strpos($v, '@') > 0) && (strpos($v, '.') > 0))
        if (strpos($v, '@') > 0)
          $result[$key]['address'] = str_replace('<', '', str_replace('>', '', $v));
        else
          $result[$key]['name'] .= (empty($result[$key]['name'])?'':' ').str_replace("\"",'',stripslashes($v));