Browse Source

fix for mailboxes with trailing delimiter in the new mailboxtree

stekkel 23 years ago
parent
commit
c4bd150546
1 changed files with 3 additions and 0 deletions
  1. 3 0
      functions/imap_mailbox.php

+ 3 - 0
functions/imap_mailbox.php

@@ -755,6 +755,9 @@ function sqimap_mailbox_tree($imap_stream) {
 	    if (preg_match("/^\*\s+LIST\s+\((.*)\)\s+\"(.*)\"\s+\"?(.+(?=\")|.+).*$/",$inbox_ary[0],$regs)) {
     		$flag = $regs[1];
     		$mbx = trim($regs[3]);
+		if (substr($mbx, -1) == $delimiter) {
+        	    $mbx = substr($mbx, 0, strlen($mbx) - 1);
+    		}
 		$sorted_lsub_ary[] = array ('mbx' => $mbx, 'flag' => $flag); 
 	    }
         }