diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2008-03-18 14:44:51 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2008-03-18 14:44:51 +0000 |
| commit | b0bfd5c66f8f1f1cf48f9aff362036e17d387d50 (patch) | |
| tree | ee095229ff9b17bffe0acc9930d6ced90789e4e7 /phpBB | |
| parent | c6c2d325bfb9626c33da97f477ae161b464adae0 (diff) | |
| download | forums-b0bfd5c66f8f1f1cf48f9aff362036e17d387d50.tar forums-b0bfd5c66f8f1f1cf48f9aff362036e17d387d50.tar.gz forums-b0bfd5c66f8f1f1cf48f9aff362036e17d387d50.tar.bz2 forums-b0bfd5c66f8f1f1cf48f9aff362036e17d387d50.tar.xz forums-b0bfd5c66f8f1f1cf48f9aff362036e17d387d50.zip | |
Correctly update board statistics for attaching orphaned files to existing posts (Bug #20185)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8451 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/docs/CHANGELOG.html | 1 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_attachments.php | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 7ba3ed9b67..6d1f0759cc 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -142,6 +142,7 @@ <li>[Fix] Allow & and | in local part of email addresses (Bug #22995)</li> <li>[Fix] Do not error out if php_uname function disabled / Authenticating on SMTP Server (Bug #22235 - patch by HoL)</li> <li>[Fix] Correctly obtain to be ignored users within topic/forum notification (Bug #21795 - patch provided by dr.death)</li> + <li>[Fix] Correctly update board statistics for attaching orphaned files to existing posts (Bug #20185)</li> </ul> diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 1db1602665..d6f32bda53 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -940,6 +940,7 @@ class acp_attachments AND is_orphan = 1'; $result = $db->sql_query($sql); + $files_added = $space_taken = 0; while ($row = $db->sql_fetchrow($result)) { $post_row = $post_info[$upload_list[$row['attach_id']]]; @@ -979,9 +980,18 @@ class acp_attachments WHERE topic_id = ' . $post_row['topic_id']; $db->sql_query($sql); + $space_taken += $row['filesize']; + $files_added++; + add_log('admin', 'LOG_ATTACH_FILEUPLOAD', $post_row['post_id'], $row['real_filename']); } $db->sql_freeresult($result); + + if ($files_added) + { + set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true); + set_config('num_files', $config['num_files'] + $files_added, true); + } } } |
