diff options
author | javiexin <javiexin@gmail.com> | 2017-07-12 13:25:22 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2017-12-27 13:27:38 +0100 |
commit | bd81af3b9e3174d1ea2dbf405b694e535e8b1b40 (patch) | |
tree | 36a7797ae5d140a67f31e19e59a9613f5f97e61f /phpBB/download/file.php | |
parent | 31b93280ee906f7ac4052540cffc210bf323f056 (diff) | |
download | forums-bd81af3b9e3174d1ea2dbf405b694e535e8b1b40.tar forums-bd81af3b9e3174d1ea2dbf405b694e535e8b1b40.tar.gz forums-bd81af3b9e3174d1ea2dbf405b694e535e8b1b40.tar.bz2 forums-bd81af3b9e3174d1ea2dbf405b694e535e8b1b40.tar.xz forums-bd81af3b9e3174d1ea2dbf405b694e535e8b1b40.zip |
[ticket/15266] Expand functionality of content_visibility
Added new function "is_visible", and replaced several immediate
uses of the above, including a single event in the new function
to handle change in all places consistently, and much simpler.
PHPBB3-15266
Diffstat (limited to 'phpBB/download/file.php')
-rw-r--r-- | phpBB/download/file.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/phpBB/download/file.php b/phpBB/download/file.php index e60ffad6b0..c0837ab7a9 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -149,6 +149,8 @@ $user->session_begin(false); $auth->acl($user->data); $user->setup('viewtopic'); +$phpbb_content_visibility = $phpbb_container->get('content.visibility'); + if (!$config['allow_attachments'] && !$config['allow_pm_attach']) { send_status_line(404, 'Not Found'); @@ -215,7 +217,7 @@ else $post_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if (!$post_row || ($post_row['post_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $post_row['forum_id']))) + if (!$post_row || !$phpbb_content_visibility->is_visible('post', $post_row['forum_id'], $post_row)) { // Attachment of a soft deleted post and the user is not allowed to see the post send_status_line(404, 'Not Found'); |