1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-05 05:55:15 +02:00

[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
This commit is contained in:
Joas Schilling 2012-10-09 17:38:08 +02:00
parent fbf85b76c1
commit 70fa983fa8

View File

@ -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');
}