diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2009-03-19 17:01:59 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2009-03-19 17:01:59 +0000 |
commit | e461162847b1ac9287870de680e8dbd17e9f2fc1 (patch) | |
tree | e93351f9856ea56167c7c40a5c765318184df5d9 /phpBB/includes/functions_admin.php | |
parent | bcabff8a1fe82452366b6f278782fd284effece4 (diff) | |
download | forums-e461162847b1ac9287870de680e8dbd17e9f2fc1.tar forums-e461162847b1ac9287870de680e8dbd17e9f2fc1.tar.gz forums-e461162847b1ac9287870de680e8dbd17e9f2fc1.tar.bz2 forums-e461162847b1ac9287870de680e8dbd17e9f2fc1.tar.xz forums-e461162847b1ac9287870de680e8dbd17e9f2fc1.zip |
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
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r-- | phpBB/includes/functions_admin.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 5da18d250c..549f854b78 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -619,7 +619,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s if ($approved_topics) { - set_config('num_topics', $config['num_topics'] - $approved_topics, true); + set_config_count('num_topics', $approved_topics * (-1), true); } return $return; @@ -776,7 +776,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = if ($approved_posts) { - set_config('num_posts', $config['num_posts'] - $approved_posts, true); + set_config_count('num_posts', $approved_posts * (-1), true); } // We actually remove topics now to not be inconsistent (the delete_topics function calls this function too) @@ -903,8 +903,8 @@ function delete_attachments($mode, $ids, $resync = true) if ($space_removed || $files_removed) { - set_config('upload_dir_size', $config['upload_dir_size'] - $space_removed, true); - set_config('num_files', $config['num_files'] - $files_removed, true); + set_config_count('upload_dir_size', $space_removed * (-1), true); + set_config_count('num_files', $files_removed * (-1), true); } // If we do not resync, we do not need to adjust any message, post, topic or user entries |