From 6b97864fbfde6ffe7b82f14c058c2141a288aa04 Mon Sep 17 00:00:00 2001 From: alec Date: Fri, 29 May 2009 09:12:10 +0000 Subject: - Fixed problem with double quote at the end of folder name (#1485884) git-svn-id: https://svn.roundcube.net/trunk@2563 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/lib/imap.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'roundcubemail/program/lib') diff --git a/roundcubemail/program/lib/imap.inc b/roundcubemail/program/lib/imap.inc index b5412e39d..1b1a4dc0d 100644 --- a/roundcubemail/program/lib/imap.inc +++ b/roundcubemail/program/lib/imap.inc @@ -83,6 +83,7 @@ - removed caching functions - handling connection startup response - added UID EXPUNGE support + - fixed problem with double quote at the end of folder name in LIST and LSUB ********************************************************/ @@ -2156,7 +2157,7 @@ function iil_C_ListMailboxes(&$conn, $ref, $mailbox) { // split one line $a = iil_ExplodeQuotedString(' ', $line); // last string is folder name - $folder = trim($a[count($a)-1], '"'); + $folder = preg_replace(array('/^"/', '/"$/'), '', $a[count($a)-1]); if (empty($ignore) || (!empty($ignore) && !preg_match('/'.preg_quote(ignore, '/').'/i', $folder))) { @@ -2223,8 +2224,8 @@ function iil_C_ListSubscribed(&$conn, $ref, $mailbox) { $a = iil_ExplodeQuotedString(' ', $line); // last string is folder name - $folder = trim($a[count($a)-1], '"'); - + $folder = preg_replace(array('/^"/', '/"$/'), '', $a[count($a)-1]); + if ((!in_array($folder, $folders)) && (empty($ignore) || (!empty($ignore) && !preg_match('/'.preg_quote(ignore, '/').'/i', $folder)))) { $folders[$i] = $folder; -- cgit v1.2.3