fix for mailboxes with trailing delimiter in the new mailboxtree
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 17 May 2002 08:27:41 +0000 (08:27 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 17 May 2002 08:27:41 +0000 (08:27 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2835 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_mailbox.php

index 7dfab0fef8f2ea0ed4813c661ebf602c5b599be0..21a0ffa70974dbf57a0369579ba0f64de0aa77f3 100755 (executable)
@@ -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); 
            }
         }