mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
Fix race condition for updating post/topic/etc. counter. (reported by BartVB)
please do not try such fixes at home - the correct solution would be to create a second config table with integer columns. ;) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9398 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -1194,8 +1194,8 @@ function mcp_fork_topic($topic_ids)
|
||||
}
|
||||
|
||||
sync('forum', 'forum_id', $to_forum_id);
|
||||
set_config('num_topics', $config['num_topics'] + sizeof($new_topic_id_list), true);
|
||||
set_config('num_posts', $config['num_posts'] + $total_posts, true);
|
||||
set_config_count('num_topics', sizeof($new_topic_id_list), true);
|
||||
set_config_count('num_posts', $total_posts, true);
|
||||
|
||||
foreach ($new_topic_id_list as $topic_id => $new_topic_id)
|
||||
{
|
||||
|
@@ -663,12 +663,12 @@ function approve_post($post_id_list, $id, $mode)
|
||||
|
||||
if ($total_topics)
|
||||
{
|
||||
set_config('num_topics', $config['num_topics'] + $total_topics, true);
|
||||
set_config_count('num_topics', $total_topics, true);
|
||||
}
|
||||
|
||||
if ($total_posts)
|
||||
{
|
||||
set_config('num_posts', $config['num_posts'] + $total_posts, true);
|
||||
set_config_count('num_posts', $total_posts, true);
|
||||
}
|
||||
unset($topic_approve_sql, $topic_replies_sql, $post_approve_sql);
|
||||
|
||||
|
@@ -501,7 +501,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
|
||||
$success_msg = 'TOPIC_SPLIT_SUCCESS';
|
||||
|
||||
// Update forum statistics
|
||||
set_config('num_topics', $config['num_topics'] + 1, true);
|
||||
set_config_count('num_topics', 1, true);
|
||||
|
||||
// Link back to both topics
|
||||
$return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>');
|
||||
|
Reference in New Issue
Block a user