diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-08-28 18:04:19 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-08-28 18:04:19 +0000 |
| commit | 62e81e742417631446e1c1e3ce7b3dcf319f8966 (patch) | |
| tree | a19c81d7b8f34313aa669e5df3069252919c1808 /roundcubemail/program/lib | |
| parent | 1e2f038be1db0f64e9e0227a570e885c2ab42846 (diff) | |
- Added option 'quota_zero_as_unlimited' (#1484604)
git-svn-id: https://svn.roundcube.net/trunk@1691 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/lib')
| -rw-r--r-- | roundcubemail/program/lib/imap.inc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/roundcubemail/program/lib/imap.inc b/roundcubemail/program/lib/imap.inc index c10c90101..7f2315671 100644 --- a/roundcubemail/program/lib/imap.inc +++ b/roundcubemail/program/lib/imap.inc @@ -63,6 +63,7 @@ - added iil_PutLine() wrapper for fputs() - code cleanup and identation fixes - removed flush() calls in iil_C_HandlePartBody() to prevent from memory leak (#1485187) + - don't return "??" from iil_C_GetQuota() ********************************************************/ @@ -2621,13 +2622,9 @@ function iil_C_GetQuota(&$conn) { $parts = explode(' ', $quota_line); $storage_part = array_search('STORAGE', $parts); if ($storage_part > 0) { - $result = array(); - $used = $parts[$storage_part+1]; - $total = $parts[$storage_part+2]; - - $result['used'] = $used; - $result['total'] = (empty($total)?"??":$total); - $result['percent'] = (empty($total)?"??":round(($used/$total)*100)); + $result['used'] = intval($parts[$storage_part+1]); + $result['total'] = intval($parts[$storage_part+2]); + $result['percent'] = min(100, round(($result['used']/max(1,$result['total']))*100)); $result['free'] = 100 - $result['percent']; } } |
