From 70fa983fa804c2a826a51af1c31ffc663cde48b3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 9 Oct 2012 17:38:08 +0200 Subject: [PATCH] [feature/soft-delete] Do not allow users to reply to soft deleted topics We should discuss this in an RFC again, but for now, we just fix the old state. So moderators can only reply, when the topic is approved. Also fixes a bug in the visibility check. We need to check the posts visibility rather then the visibility of the topic. Because when the post is visible, the topic is as well, but not the other way round. PHPBB3-9567 --- phpBB/posting.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/posting.php b/phpBB/posting.php index f4a6df3200..9f0b0d2eb9 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -128,7 +128,7 @@ switch ($mode) AND t.topic_id = p.topic_id AND u.user_id = p.poster_id AND f.forum_id = t.forum_id - AND " . phpbb_content_visibility::get_visibility_sql('topic', $forum_id, 't.'); + AND " . phpbb_content_visibility::get_visibility_sql('post', $forum_id, 'p.'); break; case 'smilies': @@ -176,7 +176,7 @@ if (!$post_data) // Not able to reply to unapproved posts/topics // TODO: add more descriptive language key -if ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'bump') && $post_data['topic_visibility'] == ITEM_UNAPPROVED) || ($mode == 'quote' && $post_data['post_visibility'] == ITEM_UNAPPROVED))) +if ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'bump') && $post_data['topic_visibility'] != ITEM_APPROVED) || ($mode == 'quote' && $post_data['post_visibility'] != ITEM_APPROVED))) { trigger_error(($mode == 'reply' || $mode == 'bump') ? 'TOPIC_UNAPPROVED' : 'POST_UNAPPROVED'); }