alecpl
2010-05-18 1d51658ba5acce01cd2e6bb30579aaccdbc41214
- Parse untagged CAPABILITY response for LOGIN command (#1486742)


2 files modified
16 ■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/include/rcube_imap_generic.php 15 ●●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail
===========================
- Parse untagged CAPABILITY response for LOGIN command (#1486742)
- Renamed all php-cli scripts to use .sh extension
- Some files from /bin + spellchecking actions moved to the new 'utils' task
- Added thread tree icons
program/include/rcube_imap_generic.php
@@ -242,11 +242,17 @@
    }
    // don't use it in loops, until you exactly know what you're doing
    private function readReply()
    private function readReply($untagged=null)
    {
        do {
            $line = trim($this->readLine(1024));
            // store untagged response lines
            if ($line[0] == '*')
                $untagged[] = $line;
        } while ($line[0] == '*');
        if ($untagged)
            $untagged = join("\n", $untagged);
        return $line;
    }
@@ -408,7 +414,12 @@
    {
        $this->putLine('a001 LOGIN "'.$this->escape($user).'" "'.$this->escape($password).'"');
        $line = $this->readReply();
        $line = $this->readReply($untagged);
        // re-set capabilities list if untagged CAPABILITY response provided
        if (preg_match('/\* CAPABILITY (.+)/i', $untagged, $matches)) {
            $this->capability = explode(' ', strtoupper($matches[1]));
        }
        // process result
        $result = $this->parseResult($line);