Aleksander Machniak
2013-07-02 ed3e51f1b41d818ae757220fd41cdf0b093b20f6
program/lib/Roundcube/rcube_imap_generic.php
@@ -715,6 +715,10 @@
            $auth_method = 'CHECK';
        }
        if (!empty($this->prefs['disabled_caps'])) {
            $this->prefs['disabled_caps'] = array_map('strtoupper', (array)$this->prefs['disabled_caps']);
        }
        $result = false;
        // initialize connection
@@ -2506,11 +2510,13 @@
            // handle one line response
            if ($line[0] == '(' && substr($line, -1) == ')') {
                // tokenize content inside brackets
                // the content can be e.g.: (UID 9844 BODY[2.4] NIL)
                $tokens = $this->tokenizeResponse(preg_replace('/(^\(|\)$)/', '', $line));
                for ($i=0; $i<count($tokens); $i+=2) {
                    if (preg_match('/^(BODY|BINARY)/i', $tokens[$i])) {
                        $result = $tokens[$i+1];
                        $i += 2; // skip BODY|BINARY and part number
                        $result = $tokens[$i];
                        $found  = true;
                        break;
                    }
@@ -3492,7 +3498,7 @@
                    break 2;
                }
                // excluded chars: SP, CTL, ), [, ]
                // excluded chars: SP, CTL, ), [, ], DEL
                if (preg_match('/^([^\x00-\x20\x29\x5B\x5D\x7F]+)/', $str, $m)) {
                    $result[] = $m[1] == 'NIL' ? NULL : $m[1];
                    $str = substr($str, strlen($m[1]));
@@ -3684,6 +3690,10 @@
        $this->capability = explode(' ', strtoupper($str));
        if (!empty($this->prefs['disabled_caps'])) {
            $this->capability = array_diff($this->capability, $this->prefs['disabled_caps']);
        }
        if (!isset($this->prefs['literal+']) && in_array('LITERAL+', $this->capability)) {
            $this->prefs['literal+'] = true;
        }