Skip to content

Commit

Permalink
Fix regression in compressMessageSet() (#6235)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Apr 6, 2018
1 parent e57c66f commit dc9c9c3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions program/lib/Roundcube/rcube_imap_generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit dc9c9c3

Please sign in to comment.