[ticket/13205] Explicitly cast ids to integers and reformat SQL

PHPBB3-13205
This commit is contained in:
Nils Adermann 2014-10-22 18:35:07 -04:00
parent b5594371ab
commit df72846b89
2 changed files with 5 additions and 5 deletions

View file

@ -918,10 +918,11 @@ function mark_folder_read($user_id, $folder_id)
{
global $db;
$sql = 'SELECT msg_id FROM ' . PRIVMSGS_TO_TABLE . "
WHERE folder_id = $folder_id
AND user_id = $user_id
AND pm_unread = 1";
$sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE folder_id = ' . ((int) $folder_id) . '
AND user_id = ' . ((int) $user_id) . '
AND pm_unread = 1';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))

View file

@ -248,7 +248,6 @@ class ucp_pm
if ($request->variable('mark', '') == 'all' && check_link_hash($request->variable('token', ''), 'mark_all_pms_read'))
{
// mark unread
mark_folder_read($user->data['user_id'], $folder_id);
meta_refresh(3, $this->u_action);