From dc9c9c36a8c7fbb821e55cd5c3cd13f36ab15ef0 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 6 Apr 2018 08:21:22 +0200 Subject: [PATCH] Fix regression in compressMessageSet() (#6235) --- program/lib/Roundcube/rcube_imap_generic.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php index e4aa298eae5..3899b235eb9 100644 --- a/program/lib/Roundcube/rcube_imap_generic.php +++ b/program/lib/Roundcube/rcube_imap_generic.php @@ -3878,16 +3878,15 @@ public static function compressMessageSet($messages, $force=false) { // given a comma delimited list of independent mid's, // compresses by grouping sequences together - if (!is_array($messages)) { // if less than 255 bytes long, let's not bother if (!$force && strlen($messages) < 255) { - return preg_match('/[^0-9:,]/', $messages) ? 'INVALID' : $messages; + return preg_match('/[^0-9:,*]/', $messages) ? 'INVALID' : $messages; } // see if it's already been compressed if (strpos($messages, ':') !== false) { - return preg_match('/[^0-9:,]/', $messages) ? 'INVALID' : $messages; + return preg_match('/[^0-9:,*]/', $messages) ? 'INVALID' : $messages; } // separate, then sort @@ -3924,7 +3923,7 @@ public static function compressMessageSet($messages, $force=false) // return as comma separated string $result = implode(',', $result); - return preg_match('/[^0-9:,]/', $result) ? 'INVALID' : $result; + return preg_match('/[^0-9:,*]/', $result) ? 'INVALID' : $result; } /**