alecpl
2009-06-22 ecb9fb058da8d0f5a8e59402c1c1ced21122cbc5
program/include/rcube_imap.php
@@ -963,7 +963,7 @@
    // try search with US-ASCII charset (should be supported by server)
    // only if UTF-8 search is not supported
    if (empty($results) && !is_array($results) && !empty($charset) && $charset!='US-ASCII')
    if (empty($results) && !is_array($results) && !empty($charset) && $charset != 'US-ASCII')
      {
   // convert strings to US_ASCII
        if(preg_match_all('/\{([0-9]+)\}\r\n/', $str, $matches, PREG_OFFSET_CAPTURE))
@@ -984,7 +984,7 @@
   else // strings for conversion not found
     $res = $str;
     
   $results = $this->search($mbox_name, $res, 'US-ASCII', $sort_field);
   $results = $this->search($mbox_name, $res, NULL, $sort_field);
      }
    $this->set_search_set($str, $results, $charset, $sort_field);
@@ -1963,7 +1963,7 @@
  /**
   * Remove mailboxes from server
   *
   * @param string Mailbox name
   * @param string Mailbox name(s) string/array
   * @return boolean True on success
   */
  function delete_mailbox($mbox_name)
@@ -1987,9 +1987,11 @@
        // send delete command to server
        $result = iil_C_DeleteFolder($this->conn, $mailbox);
        if ($result>=0)
        if ($result >= 0) {
          $deleted = TRUE;
          $this->clear_message_cache($mailbox.'.msg');
     }
        foreach ($all_mboxes as $c_mbox)
          {
          $regex = preg_quote($mailbox . $this->delimiter, '/');
@@ -1998,18 +2000,17 @@
            {
            iil_C_UnSubscribe($this->conn, $c_mbox);
            $result = iil_C_DeleteFolder($this->conn, $c_mbox);
            if ($result>=0)
            if ($result >= 0) {
              $deleted = TRUE;
            }
             $this->clear_message_cache($c_mbox.'.msg');
              }
       }
          }
        }
    // clear mailboxlist cache
    if ($deleted)
      {
      $this->clear_message_cache($mailbox.'.msg');
      $this->clear_cache('mailboxes');
      }
    return $deleted;
    }
@@ -2689,7 +2690,7 @@
  /**
   * Convert body charset to UTF-8 according to the ctype_parameters
   * Convert body charset to RCMAIL_CHARSET according to the ctype_parameters
   *
   * @param string Part body to decode
   * @param string Charset to convert from