From 12b1b54792ebbb26c8ceb77ca7b16a432f2edeca Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 26 May 2018 09:08:08 +0200 Subject: [PATCH] Fix bug where after "mark all folders as read" action message counters were not reset (#6307) also fixed one PHP 7.2 warning --- CHANGELOG | 1 + program/lib/Roundcube/rcube_imap.php | 2 +- program/steps/mail/check_recent.inc | 3 +-- program/steps/mail/func.inc | 2 +- program/steps/mail/mark.inc | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2f86a5bfb..b03c73764 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -93,6 +93,7 @@ CHANGELOG Roundcube Webmail - Fix bug where some forbidden characters on Cyrus-IMAP were not prevented from use in folder names - Fix bug where only attachments with the same name would be ignored on zip download (#6301) - Fix bug where unicode contact names could have been broken/emptied or caused DB errors (#6299) +- Fix bug where after "mark all folders as read" action message counters were not reset (#6307) RELEASE 1.3.6 ------------- diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php index 6f740003a..17a501695 100644 --- a/program/lib/Roundcube/rcube_imap.php +++ b/program/lib/Roundcube/rcube_imap.php @@ -2463,7 +2463,7 @@ class rcube_imap extends rcube_storage * @param string $folder Folder name * @param boolean $skip_cache True to skip message cache clean up * - * @return boolean Operation status + * @return boolean Operation status */ public function set_flag($uids, $flag, $folder=null, $skip_cache=false) { diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc index 984c53c41..ac0f360eb 100644 --- a/program/steps/mail/check_recent.inc +++ b/program/steps/mail/check_recent.inc @@ -71,8 +71,7 @@ foreach ($a_mailboxes as $mbox_name) { array('mailbox' => $mbox_name, 'is_current' => $is_current, 'diff' => $diff)); } - rcmail_send_unread_count($mbox_name, true, null, - (!$is_current && ($status & 1)) ? 'recent' : ''); + rcmail_send_unread_count($mbox_name, true, null, (!$is_current && ($status & 1)) ? 'recent' : ''); if ($status && $is_current) { // refresh saved search set diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 0ab2dba0f..3a6863817 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -756,7 +756,7 @@ function rcmail_send_unread_count($mbox_name, $force=false, $count=null, $mark=' $unseen = $RCMAIL->storage->count($mbox_name, 'UNSEEN', $force); } - if ($unseen != $old_unseen || ($mbox_name == 'INBOX')) { + if ($unseen !== $old_unseen || ($mbox_name == 'INBOX')) { $RCMAIL->output->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX'), $unseen && $mark ? $mark : ''); } diff --git a/program/steps/mail/mark.inc b/program/steps/mail/mark.inc index 1cb8091a2..eb5e416f4 100644 --- a/program/steps/mail/mark.inc +++ b/program/steps/mail/mark.inc @@ -70,7 +70,7 @@ if ($_uids && $flag) { foreach ($input as $mbox => $uids) { $marked += (int)$RCMAIL->storage->set_flag($uids, $flag, $mbox); - $count += count($uids); + $count += is_array($uids) ? count($uids) : 1; } if (!$marked) {