瀏覽代碼

fixed bug that didn't display folders with spaces in the name

Luke Ehresman 24 年之前
父節點
當前提交
9a652d74c4
共有 3 個文件被更改,包括 15 次插入18 次删除
  1. 1 0
      ChangeLog
  2. 6 8
      functions/imap_mailbox.php
  3. 8 10
      src/left_main.php

+ 1 - 0
ChangeLog

@@ -1,5 +1,6 @@
 Version 1.1.0 -- DEVELOPMENT
 ----------------------------
+- Preferences are now cached instead of read in every page load.
 - Improved URL parser
 - Added ability to read HTML messages by default instead of plain text (Display Options)
 - Added authenticated SMTP server support (configure in conf.pl)

+ 6 - 8
functions/imap_mailbox.php

@@ -158,7 +158,6 @@
          if (substr($mailbox, -1) == $dm)
             $mailbox = substr($mailbox, 0, strlen($mailbox) - 1);
          $boxes[$g]['unformatted'] = $mailbox;
-         //$boxes[$g]['unformatted-disp'] = ereg_replace('^' . $folder_prefix, '', $mailbox);
          if (substr($mailbox,0,strlen($folder_prefix))==$folder_prefix) { 
             $boxes[$g]['unformatted-disp'] = substr($mailbox, strlen($folder_prefix));
          } else if (strtolower($mailbox) == "inbox") {
@@ -171,9 +170,8 @@
          $flags = trim(strtolower(str_replace('\\', '',$regs[1])));
          if ($flags) {
             $boxes[$g]['flags'] = explode(' ', $flags);
-         }
-	 else
-	     $boxes[$g]['flags'] = array();
+         } else
+            $boxes[$g]['flags'] = array();
       }
 
       return $boxes;
@@ -385,10 +383,10 @@
             if ($flags) {
                $boxes[$g]['flags'] = explode(" ", $flags);
             }
-	    else
-	    {
-	       $boxes[$g]['flags'] = array();
-	    }
+            else
+            {
+               $boxes[$g]['flags'] = array();
+            }
          }
          $g++;
       }

+ 8 - 10
src/left_main.php

@@ -93,12 +93,12 @@
             $numMessages = sqimap_get_num_messages($imapConnection, $real_box);
 
          if ($numMessages > 0)
-	 {
+         {
             $urlMailbox = urlencode($real_box);
             $line .= "\n<small>\n";
             $line .= " &nbsp; (<B><A HREF=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A></B>)";
             $line .= "\n</small>\n";
-	 }
+         }
       }
       $line .= "</NOBR>";
       return $line;
@@ -156,14 +156,12 @@
 
          if (in_array('noselect', $boxes[$i]['flags'])) {
             $line .= "<FONT COLOR=\"$color[10]\">";
-            if (ereg("^( *)([^ ]*)$", $mailbox, $regs)) {
-                $line .= str_replace(' ', '&nbsp;', $regs[1]);
-                if (isset($boxes[$i]['parent']))
-                    $line .= FoldLink($boxes[$i]['unformatted'], 
-                        $boxes[$i]['parent']);
-                elseif ($collapse_folders)
-                    $line .= '<tt>&nbsp;</tt>&nbsp;';
-                $line .= str_replace(' ', '&nbsp;', $regs[2]);
+            if (ereg("^( *)([^ ]*)", $mailbox, $regs)) {
+                $line .= str_replace(' ', '&nbsp;', $mailbox);
+                //if (isset($boxes[$i]['parent']))
+                    $line .= FoldLink($boxes[$i]['unformatted'], $boxes[$i]['parent']);
+                //elseif ($collapse_folders)
+                //    $line .= '<tt>&nbsp;</tt>&nbsp;';
             }
             $line .= '</FONT>';
          } else {