mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
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:
parent
46e66c0401
commit
57ed7fd088
1 changed files with 6 additions and 3 deletions
|
@ -1707,8 +1707,8 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
|
||||||
$recipients = array();
|
$recipients = array();
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$recipients[] = $row['user_id'];
|
$recipients[] = (int) $row['user_id'];
|
||||||
$recipients[] = $row['author_id'];
|
$recipients[] = (int) $row['author_id'];
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
$recipients = array_unique($recipients);
|
$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
|
WHERE t.msg_id = p.msg_id
|
||||||
AND p.author_id = u.user_id
|
AND p.author_id = u.user_id
|
||||||
AND t.folder_id NOT IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ')
|
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";
|
AND t.user_id = $user_id";
|
||||||
|
|
||||||
|
// We no longer need those.
|
||||||
|
unset($recipients);
|
||||||
|
|
||||||
if (!$message_row['root_level'])
|
if (!$message_row['root_level'])
|
||||||
{
|
{
|
||||||
$sql .= " AND (p.root_level = $msg_id OR (p.root_level = 0 AND p.msg_id = $msg_id))";
|
$sql .= " AND (p.root_level = $msg_id OR (p.root_level = 0 AND p.msg_id = $msg_id))";
|
||||||
|
|
Loading…
Add table
Reference in a new issue