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

[ticket/9252] Do not try to disapprove a post that was just approved

Without this change, posts that are approved by someone right before
another moderator is trying to disapprove a post are actually deleted
instead of disapproved.

PHPBB3-9252
This commit is contained in:
Marc Alexander 2015-05-30 12:27:00 +02:00
parent df4b391baa
commit e04f9a2425

View File

@ -1130,6 +1130,11 @@ class mcp_queue
// Build a list of posts to be disapproved and get the related topics real replies count
foreach ($post_info as $post_id => $post_data)
{
if ($mode === 'unapproved_topics' && $post_data['post_visibility'] == ITEM_APPROVED)
{
continue;
}
$post_disapprove_list[$post_id] = $post_data['topic_id'];
if (!isset($topic_posts_unapproved[$post_data['topic_id']]))
{
@ -1139,6 +1144,12 @@ class mcp_queue
$topic_posts_unapproved[$post_data['topic_id']]++;
}
// Do not try to disapprove if no posts are selected
if (empty($post_disapprove_list))
{
trigger_error('NO_POST_SELECTED');
}
// Now we build the log array
foreach ($post_disapprove_list as $post_id => $topic_id)
{