diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-03-06 07:31:30 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-03-06 07:31:30 +0000 |
| commit | 7788fd33b17b195ccd17bd6baaa8a2377a4804fa (patch) | |
| tree | 6bf073c112d94294d994aebd4c6fff3bbdadcf9b /roundcubemail | |
| parent | ff6bcfe6265b405ed076edab1fb9a1fcce7c4bc9 (diff) | |
- Fix errors handling in IMAP command continuations (#1485762)
git-svn-id: https://svn.roundcube.net/trunk@2330 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail')
| -rw-r--r-- | roundcubemail/CHANGELOG | 4 | ||||
| -rw-r--r-- | roundcubemail/program/lib/imap.inc | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/roundcubemail/CHANGELOG b/roundcubemail/CHANGELOG index 330776e68..431ae0649 100644 --- a/roundcubemail/CHANGELOG +++ b/roundcubemail/CHANGELOG @@ -1,6 +1,10 @@ CHANGELOG RoundCube Webmail --------------------------- +2009/03/06 (alec) +---------- +- Fix errors handling in IMAP command continuations (#1485762) + 2009/03/04 (alec) ---------- - Fix datetime columns defaults in mysql's DDL (#1485641) diff --git a/roundcubemail/program/lib/imap.inc b/roundcubemail/program/lib/imap.inc index 056632209..f50abeacd 100644 --- a/roundcubemail/program/lib/imap.inc +++ b/roundcubemail/program/lib/imap.inc @@ -220,6 +220,9 @@ function iil_PutLineC($fp, $string, $endln=true) { if(preg_match('/^\{[0-9]+\}\r\n$/', $parts[$i+1])) { $res += iil_PutLine($fp, $parts[$i].$parts[$i+1], false); $line = iil_ReadLine($fp, 1000); + // handle error in command + if ($line[0] != '+') + return false; $i++; } else @@ -292,7 +295,7 @@ function iil_ReadReply($fp) { } function iil_ParseResult($string) { - $a=explode(' ', $string); + $a = explode(' ', $string); if (count($a) > 2) { if (strcasecmp($a[1], 'OK') == 0) { return 0; @@ -2142,7 +2145,9 @@ function iil_C_Search(&$conn, $folder, $criteria) { $c = 0; $query = 'srch1 SEARCH ' . chop($criteria); - iil_PutLineC($fp, $query); + if (!iil_PutLineC($fp, $query)) { + return false; + } do { $line=trim(iil_ReadLine($fp, 10000)); if (eregi("^\* SEARCH", $line)) { |
