summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-04-08 06:27:28 +0000
committeralecpl <alec@alec.pl>2011-04-08 06:27:28 +0000
commit0ea94769ee2846a0a4d0ec5d55d3bd8d6241b24a (patch)
tree7da9a6ed8f0094a1435a57da71d4ff5e7e93be50 /program/include
parent8abc17611f56e3bd265c9d6a1782771ea3165344 (diff)
- Added workaround for some IMAP server with broken STATUS response (#1487859)
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_imap_generic.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index b4479d619..932ec638d 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -953,6 +953,16 @@ class rcube_imap_generic
list($mbox, $items) = $this->tokenizeResponse($response, 2);
+ // Fix for #1487859. Some buggy server returns not quoted
+ // folder name with spaces. Let's try to handle this situation
+ if (!is_array($items) && ($pos = strpos($response, '(')) !== false) {
+ $response = substr($response, $pos);
+ $items = $this->tokenizeResponse($response, 1);
+ if (!is_array($items)) {
+ return $result;
+ }
+ }
+
for ($i=0, $len=count($items); $i<$len; $i += 2) {
$result[$items[$i]] = (int) $items[$i+1];
}