diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-12-13 11:53:03 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-12-13 11:53:03 +0000 |
| commit | 363e9080c904643a839d157b229a82dba717eb69 (patch) | |
| tree | 8bd3496f3bdcdf36cf8d83f16e33f86875b7d5f2 /roundcubemail/program/include/rcube_imap.php | |
| parent | be19db9f8eedbc823be4c26a3d4ff1d2c55c0085 (diff) | |
- Improve convert_criteria() so string literals will be not used if possible, to workaround issues with some buggy IMAP servers
git-svn-id: https://svn.roundcube.net/trunk@5598 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_imap.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_imap.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php index 3552010b8..60cc41506 100644 --- a/roundcubemail/program/include/rcube_imap.php +++ b/roundcubemail/program/include/rcube_imap.php @@ -1400,6 +1400,7 @@ class rcube_imap * @param string $charset Search charset * @param string $sort_field Header field to sort by * @access public + * @todo: Search criteria should be provided in non-IMAP format, eg. array */ function search($mailbox='', $str='ALL', $charset=NULL, $sort_field=NULL) { @@ -1520,9 +1521,9 @@ class rcube_imap $string_offset = $m[1] + strlen($m[0]) + 4; // {}\r\n $string = substr($str, $string_offset - 1, $m[0]); $string = rcube_charset_convert($string, $charset, $dest_charset); - if (!$string) + if ($string === false) continue; - $res .= sprintf("%s{%d}\r\n%s", substr($str, $last, $m[1] - $last - 1), strlen($string), $string); + $res .= substr($str, $last, $m[1] - $last - 1) . rcube_imap_generic::escape($string); $last = $m[0] + $string_offset - 1; } if ($last < strlen($str)) |
