diff --git a/CHANGELOG b/CHANGELOG index 30025de9a..416d248f3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -48,6 +48,7 @@ CHANGELOG Roundcube Webmail - Fix bug where errors were not printed when using bin/update.sh (#5834) - Fix PHP 7.2 warnings on count() use (#5845) - Fix bug where Chrome could not upload the same file that was selected before (#5854) +- Fix duplicate messages on the list after deleting messages on the next to the last page (#5862) RELEASE 1.3.0 ------------- diff --git a/program/steps/mail/move_del.inc b/program/steps/mail/move_del.inc index 5b70b97d4..0d7afdc38 100644 --- a/program/steps/mail/move_del.inc +++ b/program/steps/mail/move_del.inc @@ -161,8 +161,11 @@ if ($threading) { // add new rows from next page (if any) if ($addrows && $count && $uids != '*' && ($jump_back || $nextpage_count > 0)) { + // #5862: Don't add more rows than it was on the next page + $count = $jump_back ? null : min($nextpage_count, $count); + $a_headers = $RCMAIL->storage->list_messages($mbox, NULL, - rcmail_sort_column(), rcmail_sort_order(), $jump_back ? NULL : $count); + rcmail_sort_column(), rcmail_sort_order(), $count); rcmail_js_message_list($a_headers, false); }