Changeset 3881 in subversion


Ignore:
Timestamp:
Aug 8, 2010 6:53:57 AM (3 years ago)
Author:
alec
Message:
  • Improved performance of LIST/LSUB response parsing
File:
1 edited

Legend:

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

    r3866 r3881  
    16701670        } 
    16711671 
     1672        $ref = $this->escape($ref); 
     1673        $mailbox = $this->escape($mailbox); 
     1674 
    16721675        // send command 
    1673             if (!$this->putLine($key." ".$command." \"". $this->escape($ref) ."\" \"". $this->escape($mailbox) ."\"")) { 
     1676            if (!$this->putLine($key." ".$command." \"". $ref ."\" \"". $mailbox ."\"")) { 
    16741677                    $this->error = "Couldn't send $command command"; 
    16751678                return false; 
     
    16801683                    $line = $this->readLine(500); 
    16811684                    $line = $this->multLine($line, true); 
    1682                     $a    = explode(' ', $line); 
    1683  
    1684                     if (($line[0] == '*') && ($a[1] == $command)) { 
    1685                             $line = rtrim($line); 
    1686                         // split one line 
    1687                             $a = rcube_explode_quoted_string(' ', $line); 
    1688                         // last string is folder name 
    1689                             $folders[] = preg_replace(array('/^"/', '/"$/'), '', $this->unEscape($a[count($a)-1])); 
    1690                         // second from last is delimiter 
    1691                         $delim = trim($a[count($a)-2], '"'); 
     1685                    $line = trim($line); 
     1686 
     1687                    if (preg_match('/^\* '.$command.' \(([^\)]*)\) "*([^"]+)"* (.*)$/', $line, $m)) { 
     1688                        // folder name 
     1689                            $folders[] = preg_replace(array('/^"/', '/"$/'), '', $this->unEscape($m[3])); 
     1690                        // attributes 
     1691//                      $attrib = explode(' ', $m[1]); 
     1692                        // delimiter 
     1693//                      $delim = $m[2]; 
    16921694                    } 
    16931695            } while (!$this->startsWith($line, $key, true)); 
Note: See TracChangeset for help on using the changeset viewer.