[feature/attach-dl] Cast variables to int

PHPBB3-11042
This commit is contained in:
Fyorl 2012-08-14 14:43:36 +01:00
parent c6449b4825
commit 9729fa9a3e

View file

@ -689,9 +689,9 @@ function phpbb_download_check_pm_auth($db, $user_id, $msg_id)
// Check if the attachment is within the users scope... // Check if the attachment is within the users scope...
$sql = 'SELECT user_id, author_id $sql = 'SELECT user_id, author_id
FROM ' . PRIVMSGS_TO_TABLE . ' FROM ' . PRIVMSGS_TO_TABLE . '
WHERE msg_id = ' . $msg_id . " WHERE msg_id = ' . (int) $msg_id . '
AND user_id = $user_id AND user_id = ' . (int) $user_id . '
OR author_id = $user_id"; OR author_id = ' . (int) $user_id;
$result = $db->sql_query_limit($sql, 1); $result = $db->sql_query_limit($sql, 1);
$allowed = $db->sql_fetchrow($result); $allowed = $db->sql_fetchrow($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);