Author: bantu
Date: Thu Sep 3 14:44:16 2009
New Revision: 10092
Log:
Bug #39505, r9677 - Add integer casting and allow array to be empty. Unset array when no longer needed.
Modified:
branches/phpBB-3_0_0/phpBB/includes/functions_privmsgs.php
Modified: branches/phpBB-3_0_0/phpBB/includes/functions_privmsgs.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/includes/functions_privmsgs.php (original)
--- branches/phpBB-3_0_0/phpBB/includes/functions_privmsgs.php Thu Sep 3 14:44:16 2009
***************
*** 1707,1714 ****
$recipients = array();
while ($row = $db->sql_fetchrow($result))
{
! $recipients[] = $row['user_id'];
! $recipients[] = $row['author_id'];
}
$db->sql_freeresult($result);
$recipients = array_unique($recipients);
--- 1707,1714 ----
$recipients = array();
while ($row = $db->sql_fetchrow($result))
{
! $recipients[] = (int) $row['user_id'];
! $recipients[] = (int) $row['author_id'];
}
$db->sql_freeresult($result);
$recipients = array_unique($recipients);
***************
*** 1719,1727 ****
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 t.user_id = $user_id";
if (!$message_row['root_level'])
{
$sql .= " AND (p.root_level = $msg_id OR (p.root_level = 0 AND p.msg_id = $msg_id))";
--- 1719,1730 ----
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, 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))";
|