diff options
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); + } } } |