From e5050f8087844ed3a4f3787a15768f4a095f73fd 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 8b4f1a3e728..21a3d84c3b4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,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 2faa70b5fbd..2dcf3157616 100644 --- a/program/lib/Roundcube/rcube_imap.php +++ b/program/lib/Roundcube/rcube_imap.php @@ -2458,7 +2458,7 @@ public function print_raw_body($uid, $formatted = true) * @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 984c53c41cc..ac0f360ebd0 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 aab206e9535..81901c75b87 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -768,7 +768,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 1cb8091a2c8..eb5e416f471 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) {