diff options
| author | till <till@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-02-05 14:12:47 +0000 |
|---|---|---|
| committer | till <till@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-02-05 14:12:47 +0000 |
| commit | 9bd59469580d4a090d4af2595e63b20dadf9c0ac (patch) | |
| tree | 15e22c8c44945d207d102b71f75eb489d8b0c14e /roundcubemail/program/lib | |
| parent | ff60ce66cdea2d1fc2ef7600cd577ed26bd1654c (diff) | |
* added FIXME
* tried to debug a loop
git-svn-id: https://svn.roundcube.net/trunk@1016 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/lib')
| -rw-r--r-- | roundcubemail/program/lib/imap.inc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/roundcubemail/program/lib/imap.inc b/roundcubemail/program/lib/imap.inc index a7462a373..11ab370d9 100644 --- a/roundcubemail/program/lib/imap.inc +++ b/roundcubemail/program/lib/imap.inc @@ -162,11 +162,12 @@ function iil_ReadLine($fp, $size) { $line = ''; if ($fp) { do { + // FIXME: hardcode size? $buffer = fgets($fp, 2048); if ($buffer === false) { break; } - $line.=$buffer; + $line .= $buffer; } while ($buffer[strlen($buffer)-1]!="\n"); } return $line; @@ -176,12 +177,14 @@ function iil_MultLine($fp, $line) { $line = chop($line); if (ereg('\{[0-9]+\}$', $line)) { $out = ''; + preg_match_all('/(.*)\{([0-9]+)\}$/', $line, $a); $bytes = $a[2][0]; - while (strlen($out)<$bytes) { - $out.=chop(iil_ReadLine($fp, 1024)); + while (strlen($out) < $bytes) { + $line = iil_ReadLine($fp, 1024); + $out .= chop($line); } - $line = $a[1][0]."\"$out\""; + $line = $a[1][0] . "\"$out\""; } return $line; } |
