Changeset 02548b9 in github


Ignore:
Timestamp:
Jun 3, 2008 8:23:55 AM (5 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
68217c5
Parents:
e47aadc
Message:
  • imap.inc: Fixed iil_MultLine(): use iil_ReadBytes() instead of iil_ReadLine()
  • imap.inc: Fixed iil_C_FetchStructureString() to handle many literal strings in response (#1484969)
  • imap.inc: Removed hardcoded data size in iil_ReadLine()
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    rd1e8e3f r02548b9  
    11CHANGELOG RoundCube Webmail 
    22--------------------------- 
     3 
     42008/06/03 (alec) 
     5---------- 
     6- imap.inc: Fixed iil_MultLine(): use iil_ReadBytes() instead of iil_ReadLine() 
     7- imap.inc: Fixed iil_C_FetchStructureString() to handle many  
     8  literal strings in response (#1484969) 
     9- imap.inc: Removed hardcoded data size in iil_ReadLine() 
    310 
    4112008/05/30 (alec) 
  • program/lib/imap.inc

    rd1e8e3f r02548b9  
    5858                - added iil_Escape() with support for " and \ in folder names 
    5959                - support \ character in username in iil_C_Login() 
     60                - fixed iil_MultLine(): use iil_ReadBytes() instead of iil_ReadLine() 
     61                - fixed iil_C_FetchStructureString() to handle many literal strings in response 
     62                - removed hardcoded data size in iil_ReadLine()  
    6063 
    6164********************************************************/ 
     
    172175        return $line; 
    173176    } 
     177     
     178    if (!$size) { 
     179        $size = 1024; 
     180    } 
     181     
    174182    do { 
    175         // FIXME: hardcode size? 
    176         $buffer = fgets($fp, 2048); 
     183        $buffer = fgets($fp, $size); 
    177184        if ($buffer === false) { 
    178185            break; 
     
    191198                $bytes = $a[2][0]; 
    192199                while (strlen($out) < $bytes) { 
    193                     $line = iil_ReadLine($fp, 1024);  
    194                         $out .= chop($line); 
     200                    $line = iil_ReadBytes($fp, $bytes);  
     201                    $out .= $line; 
    195202                } 
    196203                $line = $a[1][0] . "\"$out\""; 
     
    25512558        $fp     = $conn->fp; 
    25522559        $result = false; 
     2560         
    25532561        if (iil_C_Select($conn, $folder)) { 
    25542562                $key = 'F1247'; 
     
    25562564                if (fputs($fp, "$key FETCH $id (BODYSTRUCTURE)\r\n")) { 
    25572565                        do { 
    2558                                 $line=chop(iil_ReadLine($fp, 5000)); 
    2559                                 if ($line[0] == '*') { 
    2560                                         if (ereg("\}$", $line)) { 
    2561                                                 preg_match('/(.+)\{([0-9]+)\}/', $line, $match);   
    2562                                                 $result = $match[1]; 
    2563                                                 do { 
    2564                                                         $line = chop(iil_ReadLine($fp, 100)); 
    2565                                                         if (!preg_match("/^$key/", $line)) { 
    2566                                                             $result .= $line; 
    2567                             } else { 
    2568                                 $done = true; 
    2569                             } 
    2570                                                 } while (!$done); 
    2571                                         } else { 
    2572                                                 $result = $line; 
    2573                                         } 
    2574                                         list($pre, $post) = explode('BODYSTRUCTURE ', $result); 
    2575                                          
    2576                                         //truncate last ')' and return 
    2577                                         $result = substr($post, 0, strlen($post)-1); 
    2578                                 } 
     2566                                $line = iil_ReadLine($fp, 5000); 
     2567                                $line = iil_MultLine($fp, $line); 
     2568                                $result .= $line; 
    25792569                        } while (!preg_match("/^$key/", $line)); 
     2570 
     2571                        $result = trim(substr($result, strpos($result, 'BODYSTRUCTURE')+13, -(strlen($result)-strrpos($result, ')')-1))); 
    25802572                } 
    25812573        } 
Note: See TracChangeset for help on using the changeset viewer.