Bug #39505, r9677 - Add integer casting and allow array to be empty. Unset array when no longer needed.

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10092 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Andreas Fischer 2009-09-03 13:44:16 +00:00
parent 46e66c0401
commit 57ed7fd088

View file

@ -1707,8 +1707,8 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
$recipients = array();
while ($row = $db->sql_fetchrow($result))
{
$recipients[] = $row['user_id'];
$recipients[] = $row['author_id'];
$recipients[] = (int) $row['user_id'];
$recipients[] = (int) $row['author_id'];
}
$db->sql_freeresult($result);
$recipients = array_unique($recipients);
@ -1719,9 +1719,12 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
WHERE t.msg_id = p.msg_id
AND p.author_id = u.user_id
AND t.folder_id NOT IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ')
AND ' . $db->sql_in_set('t.author_id', $recipients) . "
AND ' . $db->sql_in_set('t.author_id', $recipients, false, true) . "
AND t.user_id = $user_id";
// We no longer need those.
unset($recipients);
if (!$message_row['root_level'])
{
$sql .= " AND (p.root_level = $msg_id OR (p.root_level = 0 AND p.msg_id = $msg_id))";