alecpl
2011-06-27 0891b1d2ec6b576000c0fe9150257d4f03c53536
- Fix handling of untagged responses in LIST/LSUB response parser


1 files modified
10 ■■■■■ changed files
program/include/rcube_imap_generic.php 10 ●●●●● patch | view | raw | blame | history
program/include/rcube_imap_generic.php
@@ -2180,7 +2180,7 @@
            while ($this->tokenizeResponse($response, 1) == '*') {
                $cmd = strtoupper($this->tokenizeResponse($response, 1));
                // * LIST (<options>) <delimiter> <mailbox>
                if (!$lstatus || $cmd == 'LIST' || $cmd == 'LSUB') {
                if ($cmd == 'LIST' || $cmd == 'LSUB') {
                    list($opts, $delim, $mailbox) = $this->tokenizeResponse($response, 3);
                    // Add to result array
@@ -2209,6 +2209,14 @@
                        $folders[$mailbox][$name] = $value;
                    }
                }
                // other untagged response line, skip it
                else {
                    $response = ltrim($response);
                    if (($position = strpos($response, "\n")) !== false)
                        $response = substr($response, $position+1);
                    else
                        $response = '';
                }
            }
            return $folders;