Changeset 4137 in subversion


Ignore:
Timestamp:
Oct 26, 2010 4:43:23 AM (3 years ago)
Author:
alec
Message:
  • Improve pre-auth and auth capabilities handling
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_imap_generic.php

    r4136 r4137  
    513513            // optional CAPABILITY response 
    514514                if ($line && preg_match('/\[CAPABILITY ([^]]+)\]/i', $line, $matches)) { 
    515                         $this->parseCapability($matches[1]); 
     515                        $this->parseCapability($matches[1], true); 
    516516                } 
    517517            return $this->fp; 
     
    539539        // re-set capabilities list if untagged CAPABILITY response provided 
    540540            if (preg_match('/\* CAPABILITY (.+)/i', $response, $matches)) { 
    541                     $this->parseCapability($matches[1]); 
     541                    $this->parseCapability($matches[1], true); 
    542542            } 
    543543 
     
    747747            // RFC3501 [7.1] optional CAPABILITY response 
    748748            if (preg_match('/\[CAPABILITY ([^]]+)\]/i', $line, $matches)) { 
    749                     $this->parseCapability($matches[1]); 
    750             $this->capability_readed = true; 
     749                    $this->parseCapability($matches[1], true); 
    751750            } 
    752751 
     
    796795        } 
    797796 
     797        // pre-login capabilities can be not complete 
     798        $this->capability_readed = false; 
     799 
    798800        // Authenticate 
    799801        foreach ($auth_methods as $method) { 
     
    819821            if (is_resource($result)) { 
    820822            if ($this->prefs['force_caps']) { 
    821                 // forget current capabilities 
    822823                            $this->clearCapability(); 
    823             } else { 
    824                 // pre-login capabilities can be not complete 
    825                 $this->capability_readed = false; 
    826824            } 
    827825                    $this->getRootDir(); 
     
    28592857            && preg_match('/\[CAPABILITY ([^]]+)\]/i', $line, $matches) 
    28602858        ) { 
    2861                     $this->parseCapability($matches[1]); 
     2859                    $this->parseCapability($matches[1], true); 
    28622860            } 
    28632861 
     
    30002998    } 
    30012999 
    3002     private function parseCapability($str) 
     3000    private function parseCapability($str, $trusted=false) 
    30033001    { 
    30043002        $str = preg_replace('/^\* CAPABILITY /i', '', $str); 
     
    30083006        if (!isset($this->prefs['literal+']) && in_array('LITERAL+', $this->capability)) { 
    30093007            $this->prefs['literal+'] = true; 
     3008        } 
     3009 
     3010        if ($trusted) { 
     3011            $this->capability_readed = true; 
    30103012        } 
    30113013    } 
Note: See TracChangeset for help on using the changeset viewer.