[dev] Folder::getDelimiter()

Nuno Loureiro nuno@co.eth.pt
06 May 2002 18:39:16 +0100


Hi!

Here's a very small patch to Folder::getDelimiter().

Folder::getDelimiter() calls the php function imap_getmailboxes() with
the last argument empty (pattern). According to php manual: "pattern
specifies where in the mailbox hierarchy to start searching. If you want
all mailboxes, pass '*' for pattern.". Because this function is used to
get the delimiter, I think % as the pattern would be fine ('%' as the
pattern parameter will return only the top level mailboxes;). 

I just think we should set this third parameter to something. I found
this because it gave me an error with my setup (not an usual setup with
a common imap server so it doesn't matter here). If you agree with this
small change here's the respective patch.

Index: imp/lib/Folder.php
===================================================================
RCS file: /repository/imp/lib/Folder.php,v
retrieving revision 1.68
diff -u -r1.68 Folder.php
--- imp/lib/Folder.php	23 Apr 2002 16:20:02 -0000	1.68
+++ imp/lib/Folder.php	6 May 2002 17:32:42 -0000
@@ -506,7 +506,7 @@
         static $delimiter;
 
         if (!isset($delimiter)) {
-            $box = imap_getmailboxes($stream, IMP::serverString(), '');
+            $box = imap_getmailboxes($stream, IMP::serverString(), '%');
             $delimiter = !empty($box[0]->delimiter) ? $box[0]->delimiter : $default;
         }
 


-- 
Nuno Loureiro <nuno@eth.pt>
Ethernet, Soluções Informáticas, LDA
http://www.eth.pt