aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2009-09-03 13:44:16 +0000
committerAndreas Fischer <bantu@phpbb.com>2009-09-03 13:44:16 +0000
commit57ed7fd0886f66b9cb465f7acd60be7ee1024fed (patch)
treec2bb73c0bdc56d2a87f94e28b39cfb934fb0de67 /phpBB/includes
parent46e66c04011288a79ffb6232e4ccecb20240f2ce (diff)
downloadforums-57ed7fd0886f66b9cb465f7acd60be7ee1024fed.tar
forums-57ed7fd0886f66b9cb465f7acd60be7ee1024fed.tar.gz
forums-57ed7fd0886f66b9cb465f7acd60be7ee1024fed.tar.bz2
forums-57ed7fd0886f66b9cb465f7acd60be7ee1024fed.tar.xz
forums-57ed7fd0886f66b9cb465f7acd60be7ee1024fed.zip
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
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions_privmsgs.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index f6dd29cd99..848218ca83 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -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))";