diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-09-29 11:46:21 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-09-29 11:46:21 +0000 |
| commit | ffc0b3d0790c5f4fcf2076cc3d8c319bb5ceba69 (patch) | |
| tree | 2996a0753068ea41d08eb9b840b98cc6690e4b4d /roundcubemail | |
| parent | af00477adb9be911bb4944646862723a54b8b141 (diff) | |
- small improvement: don't use implode to check array elements
git-svn-id: https://svn.roundcube.net/trunk@1899 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail')
| -rw-r--r-- | roundcubemail/program/lib/imap.inc | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/roundcubemail/program/lib/imap.inc b/roundcubemail/program/lib/imap.inc index 17197d872..7c257de97 100644 --- a/roundcubemail/program/lib/imap.inc +++ b/roundcubemail/program/lib/imap.inc @@ -700,15 +700,15 @@ function iil_C_ExpireCachedItems(&$conn, $folder, $message_set) { } function iil_ExplodeQuotedString($delimiter, $string) { - $quotes=explode('"', $string); + $quotes = explode('"', $string); while ( list($key, $val) = each($quotes)) { if (($key % 2) == 1) { $quotes[$key] = str_replace($delimiter, "_!@!_", $quotes[$key]); } } - $string=implode('"', $quotes); + $string = implode('"', $quotes); - $result=explode($delimiter, $string); + $result = explode($delimiter, $string); while ( list($key, $val) = each($result) ) { $result[$key] = str_replace('_!@!_', $delimiter, $result[$key]); } @@ -2019,11 +2019,9 @@ function iil_FormatSearchDate($month, $day, $year) { function iil_C_CountUnseen(&$conn, $folder) { $index = iil_C_Search($conn, $folder, 'ALL UNSEEN'); if (is_array($index)) { - $str = implode(',', $index); - if (empty($str)) { - return false; - } - return count($index); + if (($cnt = count($index)) && $index[0] != '') { + return $cnt; + } } return false; } @@ -2031,11 +2029,7 @@ function iil_C_CountUnseen(&$conn, $folder) { function iil_C_UID2ID(&$conn, $folder, $uid) { if ($uid > 0) { $id_a = iil_C_Search($conn, $folder, "UID $uid"); - if (is_array($id_a)) { - $count = count($id_a); - if ($count > 1) { - return false; - } + if (is_array($id_a) && count($id_a) == 1) { return $id_a[0]; } } |
