thomascube
2005-11-18 4b0f65a597c8339b513bc44e16a95f3803c26369
program/include/rcube_imap.inc
@@ -464,6 +464,7 @@
      
    // sort headers by a specific col
    $a_headers = iil_SortHeaders($a_msg_headers, $sort_field, $sort_order);
    $headers_count = count($a_headers);
   // free memory
   unset($a_msg_headers);
@@ -471,6 +472,14 @@
    // write headers list to cache
    if (!$headers_cached)
      $this->update_cache($mailbox.'.msg', $a_headers);
    // update message count cache
    $a_mailbox_cache = $this->get_cache('messagecount');
    if (isset($a_mailbox_cache[$mailbox]['ALL']) && $a_mailbox_cache[$mailbox]['ALL'] != $headers_count)
      {
      $a_mailbox_cache[$mailbox]['ALL'] = (int)$headers_count;
      $this->update_cache('messagecount', $a_mailbox_cache);
      }
   if (empty($a_headers))
      return array();
@@ -979,6 +988,12 @@
  function decode_header($input)
    {
    return $this->decode_mime_string($input);
    }
  function decode_mime_string($input)
    {
    $out = '';
    $pos = strpos($input, '=?');
@@ -993,8 +1008,8 @@
      $encstr = substr($input, $pos+2, ($end_pos-$pos-2));
      $rest = substr($input, $end_pos+2);
      $out .= $this->decode_mime_string($encstr);
      $out .= $this->decode_header($rest);
      $out .= rcube_imap::_decode_mime_string_part($encstr);
      $out .= rcube_imap::decode_mime_string($rest);
      return $out;
      }
@@ -1003,7 +1018,7 @@
    }
  function decode_mime_string($str)
  function _decode_mime_string_part($str)
    {
    $a = explode('?', $str);
    $count = count($a);