aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_download.php
diff options
context:
space:
mode:
authorFyorl <gaelreth@gmail.com>2012-08-15 06:10:53 +0800
committerFyorl <gaelreth@gmail.com>2012-08-15 06:10:53 +0800
commit227ae48255f7bfb2dd4387c83df3af5320102615 (patch)
tree47819d604f8098e093187bb9015c44116facbb28 /phpBB/includes/functions_download.php
parent5827250a94e38d9b637ed8ae9e9c4a584223cc31 (diff)
downloadforums-227ae48255f7bfb2dd4387c83df3af5320102615.tar
forums-227ae48255f7bfb2dd4387c83df3af5320102615.tar.gz
forums-227ae48255f7bfb2dd4387c83df3af5320102615.tar.bz2
forums-227ae48255f7bfb2dd4387c83df3af5320102615.tar.xz
forums-227ae48255f7bfb2dd4387c83df3af5320102615.zip
[feature/attach-dl] Optimised an sql query
PHPBB3-11042
Diffstat (limited to 'phpBB/includes/functions_download.php')
-rw-r--r--phpBB/includes/functions_download.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
index 182fce222b..b6371dbecc 100644
--- a/phpBB/includes/functions_download.php
+++ b/phpBB/includes/functions_download.php
@@ -687,7 +687,7 @@ function phpbb_download_handle_pm_auth($db, $auth, $user_id, $msg_id)
function phpbb_download_check_pm_auth($db, $user_id, $msg_id)
{
// Check if the attachment is within the users scope...
- $sql = 'SELECT user_id, author_id
+ $sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE msg_id = ' . (int) $msg_id . '
AND (
@@ -695,7 +695,7 @@ function phpbb_download_check_pm_auth($db, $user_id, $msg_id)
OR author_id = ' . (int) $user_id . '
)';
$result = $db->sql_query_limit($sql, 1);
- $allowed = $db->sql_fetchrow($result);
+ $allowed = (bool) $db->sql_fetchfield('msg_id');
$db->sql_freeresult($result);
return $allowed;