diff options
author | Marc Alexander <admin@m-a-styles.de> | 2017-12-27 14:15:27 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2017-12-27 14:15:27 +0100 |
commit | 6acfe2a0cb584de823bc0633e6a864180effebf8 (patch) | |
tree | 38fd99900468ccea5ea20a59fa299cb4c3d08dc8 /phpBB/includes/functions_download.php | |
parent | cb233c862babd5492d34ad8adcf384b28a28fb75 (diff) | |
parent | dc48f28da1d4ff4ae2956648c70b8291de1d904e (diff) | |
download | forums-6acfe2a0cb584de823bc0633e6a864180effebf8.tar forums-6acfe2a0cb584de823bc0633e6a864180effebf8.tar.gz forums-6acfe2a0cb584de823bc0633e6a864180effebf8.tar.bz2 forums-6acfe2a0cb584de823bc0633e6a864180effebf8.tar.xz forums-6acfe2a0cb584de823bc0633e6a864180effebf8.zip |
Merge pull request #4868 from javiexin/ticket/15266
[ticket/15266] Fix events in content_visibility
Diffstat (limited to 'phpBB/includes/functions_download.php')
-rw-r--r-- | phpBB/includes/functions_download.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php index e00be1e01a..e3af294b75 100644 --- a/phpBB/includes/functions_download.php +++ b/phpBB/includes/functions_download.php @@ -662,6 +662,8 @@ function phpbb_increment_downloads($db, $ids) */ function phpbb_download_handle_forum_auth($db, $auth, $topic_id) { + global $phpbb_container; + $sql_array = array( 'SELECT' => 't.topic_visibility, t.forum_id, f.forum_name, f.forum_password, f.parent_id', 'FROM' => array( @@ -677,7 +679,9 @@ function phpbb_download_handle_forum_auth($db, $auth, $topic_id) $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if ($row && $row['topic_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $row['forum_id'])) + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + + if ($row && !$phpbb_content_visibility->is_visible('topic', $row['forum_id'], $row)) { send_status_line(404, 'Not Found'); trigger_error('ERROR_NO_ATTACHMENT'); |