[Svn] r4220 - trunk/roundcubemail/program/include

trac at roundcube.net trac at roundcube.net
Fri Nov 12 15:43:33 CET 2010


Author: alec
Date: 2010-11-12 08:43:33 -0600 (Fri, 12 Nov 2010)
New Revision: 4220

Modified:
   trunk/roundcubemail/program/include/rcube_imap.php
Log:
- More fixes for folders with name "0"


Modified: trunk/roundcubemail/program/include/rcube_imap.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap.php	2010-11-12 13:05:18 UTC (rev 4219)
+++ trunk/roundcubemail/program/include/rcube_imap.php	2010-11-12 14:43:33 UTC (rev 4220)
@@ -724,7 +724,7 @@
      */
     function list_headers($mbox_name='', $page=NULL, $sort_field=NULL, $sort_order=NULL, $slice=0)
     {
-        $mailbox = $mbox_name ? $this->mod_mailbox($mbox_name) : $this->mailbox;
+        $mailbox = strlen($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;
         return $this->_list_headers($mailbox, $page, $sort_field, $sort_order, false, $slice);
     }
 
@@ -1289,7 +1289,7 @@
      */
     function mailbox_status($mbox_name = null)
     {
-        $mailbox = $mbox_name ? $this->mod_mailbox($mbox_name) : $this->mailbox;
+        $mailbox = strlen($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;
         $old = $this->get_folder_stats($mailbox);
 
         // refresh message count -> will update
@@ -1356,7 +1356,7 @@
 
         $this->_set_sort_order($sort_field, $sort_order);
 
-        $mailbox = $mbox_name ? $this->mod_mailbox($mbox_name) : $this->mailbox;
+        $mailbox = strlen($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;
         $key = "{$mailbox}:{$this->sort_field}:{$this->sort_order}:{$this->search_string}.msgi";
 
         // we have a saved search result, get index from there
@@ -1466,7 +1466,7 @@
     {
         $this->_set_sort_order($sort_field, $sort_order);
 
-        $mailbox = $mbox_name ? $this->mod_mailbox($mbox_name) : $this->mailbox;
+        $mailbox = strlen($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;
         $key = "{$mailbox}:{$this->sort_field}:{$this->sort_order}:{$this->search_string}.thi";
 
         // we have a saved search result, get index from there
@@ -1643,7 +1643,7 @@
         if (!$str)
             return false;
 
-        $mailbox = $mbox_name ? $this->mod_mailbox($mbox_name) : $this->mailbox;
+        $mailbox = strlen($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;
 
         $results = $this->_search_index($mailbox, $str, $charset, $sort_field);
 
@@ -1748,7 +1748,7 @@
         if (!$str)
             return false;
 
-        $mailbox = $mbox_name ? $this->mod_mailbox($mbox_name) : $this->mailbox;
+        $mailbox = strlen($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;
 
         return $this->conn->search($mailbox, $str, $ret_uid);
     }
@@ -1925,7 +1925,7 @@
      */
     function get_headers($id, $mbox_name=NULL, $is_uid=true, $bodystr=false)
     {
-        $mailbox = $mbox_name ? $this->mod_mailbox($mbox_name) : $this->mailbox;
+        $mailbox = strlen($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;
         $uid = $is_uid ? $id : $this->_id2uid($id, $mailbox);
 
         // get cached headers
@@ -2458,7 +2458,7 @@
      */
     function set_flag($uids, $flag, $mbox_name=NULL, $skip_cache=false)
     {
-        $mailbox = $mbox_name ? $this->mod_mailbox($mbox_name) : $this->mailbox;
+        $mailbox = strlen($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;
 
         $flag = strtoupper($flag);
         list($uids, $all_mode) = $this->_parse_uids($uids, $mailbox);
@@ -2668,7 +2668,7 @@
      */
     function delete_message($uids, $mbox_name='')
     {
-        $mailbox = $mbox_name ? $this->mod_mailbox($mbox_name) : $this->mailbox;
+        $mailbox = strlen($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;
 
         list($uids, $all_mode) = $this->_parse_uids($uids, $mailbox);
 
@@ -2749,7 +2749,7 @@
      */
     function expunge($mbox_name='', $clear_cache=true)
     {
-        $mailbox = $mbox_name ? $this->mod_mailbox($mbox_name) : $this->mailbox;
+        $mailbox = strlen($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;
         return $this->_expunge($mailbox, $clear_cache);
     }
 
@@ -2834,7 +2834,7 @@
      */
     function get_id($uid, $mbox_name=NULL)
     {
-        $mailbox = $mbox_name ? $this->mod_mailbox($mbox_name) : $this->mailbox;
+        $mailbox = strlen($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;
         return $this->_uid2id($uid, $mailbox);
     }
 
@@ -2846,9 +2846,9 @@
      * @param string $mbox_name Mailbox name
      * @return int   Message UID
      */
-    function get_uid($id,$mbox_name=NULL)
+    function get_uid($id, $mbox_name=NULL)
     {
-        $mailbox = $mbox_name ? $this->mod_mailbox($mbox_name) : $this->mailbox;
+        $mailbox = strlen($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;
         return $this->_id2uid($id, $mailbox);
     }
 
@@ -4457,7 +4457,7 @@
      */
     private function _uid2id($uid, $mbox_name=NULL)
     {
-        if (!$mbox_name)
+        if (!strlen($mbox_name))
             $mbox_name = $this->mailbox;
 
         if (!isset($this->uid_id_map[$mbox_name][$uid])) {
@@ -4479,7 +4479,7 @@
      */
     private function _id2uid($id, $mbox_name=NULL)
     {
-        if (!$mbox_name)
+        if (!strlen($mbox_name))
             $mbox_name = $this->mailbox;
 
         if ($uid = array_search($id, (array)$this->uid_id_map[$mbox_name]))
@@ -4540,7 +4540,7 @@
     private function _set_messagecount($mbox_name, $mode, $increment)
     {
         $a_mailbox_cache = false;
-        $mailbox = $mbox_name ? $mbox_name : $this->mailbox;
+        $mailbox = strlen($mbox_name) ? $mbox_name : $this->mailbox;
         $mode = strtoupper($mode);
 
         $a_mailbox_cache = $this->get_cache('messagecount');
@@ -4568,7 +4568,7 @@
      */
     private function _clear_messagecount($mbox_name='', $mode=null)
     {
-        $mailbox = $mbox_name ? $mbox_name : $this->mailbox;
+        $mailbox = strlen($mbox_name) ? $mbox_name : $this->mailbox;
 
         $a_mailbox_cache = $this->get_cache('messagecount');
 

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list