Minor improvements (#1605)

* Minor improvements

* Updated

* Update functions_delete.php

* Update attach_maintenance.php

* Update attach_maintenance.php

* Update config.php

* Updated

* Update viewtopic_attach.tpl

* Updated

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-08-21 01:41:57 +07:00 committed by GitHub
commit 82e7552a9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 22 additions and 15 deletions

View file

@ -48,7 +48,7 @@ if ($dir = @opendir($attach_dir)) {
$f_len = 0;
while (false !== ($f = readdir($dir))) {
if ($f == 'index.php' || $f == '.htaccess' || is_dir("$attach_dir/$f") || is_link("$attach_dir/$f")) {
if (str_starts_with($f, \TorrentPier\TorrServerAPI::M3U['prefix']) || $f == 'index.php' || $f == '.htaccess' || is_dir("$attach_dir/$f") || is_link("$attach_dir/$f")) {
continue;
}
$f = DB()->escape($f);
@ -144,7 +144,7 @@ if ($check_attachments) {
$orphan_db_attach[] = $row['attach_id'];
}
// Delete all orphan attachments
if ($bb_cfg['torr_server']['enabled']) {
if ($bb_cfg['torr_server']['enabled'] && $fix_errors) {
foreach ($orphan_db_attach as $attach_id) {
// TorrServer integration
$torrServer = new \TorrentPier\TorrServerAPI();