Don't update download counter if attachment not exists (#1345)

* Don't update download counter if attachment not exists

* Update CHANGELOG.md

* Update CHANGELOG.md

* Updated
This commit is contained in:
Roman Kelesidis 2024-01-27 10:33:02 +07:00 committed by GitHub
commit 8b78253ddc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 381 additions and 25 deletions

View file

@ -181,11 +181,6 @@ function display_attachments($post_id)
for ($i = 0; $i < $num_attachments; $i++) {
$filename = $upload_dir . '/' . basename($attachments['_' . $post_id][$i]['physical_filename']);
// Checks the file existence
if (!is_file($filename)) {
continue;
}
$upload_image = '';
if ($attach_config['upload_img'] && empty($upload_icons[$attachments['_' . $post_id][$i]['extension']])) {
$upload_image = '<img src="' . $attach_config['upload_img'] . '" alt="" border="0" />';