From a411d8cb87414c4cd61b7653fdff2be8cfac580d Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 6 Aug 2018 11:08:07 +0200 Subject: [PATCH] Fix PHP warnings on dummy QUOTA responses in Courier-IMAP 4.17.1 (#6374) --- CHANGELOG | 2 ++ program/lib/Roundcube/rcube_imap_generic.php | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 8d6398e7141..20508b38630 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ CHANGELOG Roundcube Webmail =========================== +- Fix PHP warnings on dummy QUOTA responses in Courier-IMAP 4.17.1 (#6374) + RELEASE 1.3.7 ------------- - Fix PHP Warning: Use of undefined constant IDNA_DEFAULT on systems without php-intl (#6244) diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php index 61564bb1aeb..7fce2d02c85 100644 --- a/program/lib/Roundcube/rcube_imap_generic.php +++ b/program/lib/Roundcube/rcube_imap_generic.php @@ -3126,6 +3126,11 @@ public function getQuota($mailbox = null) list(, , $quota_root) = $this->tokenizeResponse($line, 3); $quotas = $this->tokenizeResponse($line, 1); + + if (empty($quotas)) { + continue; + } + foreach (array_chunk($quotas, 3) as $quota) { list($type, $used, $total) = $quota; $type = strtolower($type);