aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/docs/CHANGELOG.html1
-rw-r--r--phpBB/includes/mcp/mcp_queue.php15
2 files changed, 14 insertions, 2 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index d24b512709..23bc728b7e 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -88,6 +88,7 @@
<ul>
<li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li>
+ <li>[Fix] Posts incremented for multiple approval of the same topic (Bug #40495 - Patch by TerraFrost)</li>
<li>[Fix] Missing read permission from calls to phpbb_chmod()</li>
<li>[Change] Allow download of conflicting file for later reference in automatic updater</li>
<li>[Change] Default difference view is now 'inline' instead of 'side by side'</li>
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index aa77dbdf16..e113cfc232 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -492,12 +492,18 @@ function approve_post($post_id_list, $id, $mode)
$total_topics = $total_posts = 0;
$forum_topics_posts = $topic_approve_sql = $topic_replies_sql = $post_approve_sql = $topic_id_list = $forum_id_list = $approve_log = array();
- $user_posts_sql = array();
+ $user_posts_sql = $post_approved_list = array();
$update_forum_information = false;
foreach ($post_info as $post_id => $post_data)
{
+ if ($post_data['post_approved'])
+ {
+ $post_approved_list[] = $post_id;
+ continue;
+ }
+
$topic_id_list[$post_data['topic_id']] = 1;
if ($post_data['forum_id'])
@@ -583,6 +589,11 @@ function approve_post($post_id_list, $id, $mode)
$update_forum_information = true;
}
}
+ $post_id_list = array_values(array_diff($post_id_list, $post_approved_list));
+ for ($i = 0, $size = sizeof($post_approved_list); $i < $size; $i++)
+ {
+ unset($post_info[$post_approved_list[$i]]);
+ }
if (sizeof($topic_approve_sql))
{
@@ -733,7 +744,7 @@ function approve_post($post_id_list, $id, $mode)
}
else
{
- $success_msg = (sizeof($post_id_list) == 1) ? 'POST_APPROVED_SUCCESS' : 'POSTS_APPROVED_SUCCESS';
+ $success_msg = (sizeof($post_id_list) + sizeof($post_approved_list) == 1) ? 'POST_APPROVED_SUCCESS' : 'POSTS_APPROVED_SUCCESS';
}
}
else