From 694205bb68868f56e4b2eb1acb84ec592868b183 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Tue, 11 Jan 2022 09:07:59 +0000 Subject: [PATCH] Fix mixed use of message ID list (#2859) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14936 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 15 ++++++++++----- src/read_body.php | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index ad3e7863..27ca3a1d 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -82,7 +82,8 @@ function sqimap_msgs_list_delete($imap_stream, $mailbox, $id, $bypass_trash=fals /** * Set a flag on the provided uid list * @param resource imap connection - * @param array $id list with uid's + * @param mixed $id Normally an array which is a list with message UIDs to be flagged + * or a string range such as "1:*" * @param string $flag Flags to set/unset flags can be i.e.'\Seen', '\Answered', '\Seen \Answered' * @param bool $set add (true) or remove (false) the provided flag * @param bool $handle_errors Show error messages in case of a NO, BAD or BYE response @@ -92,8 +93,12 @@ function sqimap_toggle_flag($imap_stream, $id, $flag, $set, $handle_errors) { $msgs_id = sqimap_message_list_squisher($id); $set_string = ($set ? '+' : '-'); - for ($i=0; $iheader; // they SHOULD be included as part of the FETCH responses." // if ($imap_server_type == 'gmail') { - sqimap_toggle_flag($imapConnection, $passed_id, '\\Seen', true, true); + sqimap_toggle_flag($imapConnection, array($passed_id), '\\Seen', true, true); } /****************************************/ -- 2.25.1