From 59b0de95906b2acfbb4dad46e120ecda51639657 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Mon, 11 Dec 2023 20:12:16 +0000 Subject: [PATCH] Fix: Don't feed an integer to sizeof() git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@15001 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index dfb4b6b5..2c557554 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -614,7 +614,10 @@ function sqimap_get_small_header_list($imap_stream, $msg_list, * whatever order they wish... So we need to re-sort manually */ if ($bUidFetch) { - for ($i = 0; $i < sizeof($msg_list); $i++) { + // 1.4.x had a problem where $msg_list wasn't guaranteed to be an array, + // but the following doesn't seem to be necessary in 1.5.x + $msg_count = is_array($msg_list) ? sizeof($msg_list) : 1; + for ($i = 0; $i < $msg_count; $i++) { $aMessageList[$msg_list[$i]] = array(); } } -- 2.25.1