From 66c1363fe802f232d315295c8ae992f38d378b2a Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 21 Nov 2024 16:01:24 +0100 Subject: [PATCH] Fix BC break intruduced in the last commit --- program/lib/Roundcube/rcube_imap_cache.php | 2 +- program/lib/Roundcube/rcube_imap_generic.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/program/lib/Roundcube/rcube_imap_cache.php b/program/lib/Roundcube/rcube_imap_cache.php index a99f554a2d8..40aa061eb6a 100644 --- a/program/lib/Roundcube/rcube_imap_cache.php +++ b/program/lib/Roundcube/rcube_imap_cache.php @@ -1094,7 +1094,7 @@ public function synchronize($mailbox) $mbox_data = $this->imap->folder_data($mailbox); // Removed messages found - $uids = isset($mbox_data['VANISHED']) ? rcube_imap_generic::uncompressMessageSet($mbox_data['VANISHED']) : null; + $uids = !empty($mbox_data['VANISHED']) ? rcube_imap_generic::uncompressMessageSet($mbox_data['VANISHED']) : null; if (!empty($uids)) { $removed = array_merge($removed, $uids); // Invalidate index diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php index fc2b7585daf..ecb1f2f12e7 100644 --- a/program/lib/Roundcube/rcube_imap_generic.php +++ b/program/lib/Roundcube/rcube_imap_generic.php @@ -2062,7 +2062,8 @@ public function fetchHeaderIndex($mailbox, $message_set, $index_field = '', $ski { // Validate input if (is_array($message_set)) { - if (($message_set = $this->compressMessageSet($message_set)) === 'INVALID') { + $message_set = $this->compressMessageSet($message_set); + if ($message_set === '' || $message_set === 'INVALID') { return false; } } elseif (empty($message_set)) { @@ -4042,7 +4043,7 @@ protected static function r_implode($element) * @param array|string $messages Message identifiers * @param bool $force Forces compression of any size * - * @return string Compressed sequence-set or 'INVALID' on invalid or empty input + * @return string Compressed sequence-set or 'INVALID' on invalid input */ public static function compressMessageSet($messages, $force = false) { @@ -4064,7 +4065,7 @@ public static function compressMessageSet($messages, $force = false) } if (empty($messages)) { - return 'INVALID'; + return ''; } sort($messages);