summaryrefslogtreecommitdiff
path: root/program/lib/imap.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-05-29 09:12:10 +0000
committeralecpl <alec@alec.pl>2009-05-29 09:12:10 +0000
commit2ff8af15a46503d8eef80b9c62134e25229d0671 (patch)
tree0abf6ce25e6a1c8b0df9d00e1fdd9fb1e2857498 /program/lib/imap.inc
parentadc0bf01f55ac84cfad47f1530f6e3e0319b58fe (diff)
- Fixed problem with double quote at the end of folder name (#1485884)
Diffstat (limited to 'program/lib/imap.inc')
-rw-r--r--program/lib/imap.inc7
1 files changed, 4 insertions, 3 deletions
diff --git a/program/lib/imap.inc b/program/lib/imap.inc
index b5412e39d..1b1a4dc0d 100644
--- a/program/lib/imap.inc
+++ b/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;