From 860c863a118c0d6064f115bff7903d95b95e8680 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 18 Dec 2023 18:28:03 +0700 Subject: [PATCH] Minor improvements (#1219) * Minor improvements * Update CHANGELOG.md --- CHANGELOG.md | 2 +- dl.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98a2c1e7b..3fe683dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ - search.php parameter sanitizing [\#1213](https://github.com/torrentpier/torrentpier/pull/1213) ([kovalensky](https://github.com/kovalensky), [belomaxorka](https://github.com/belomaxorka)) - Limit execution time for forum file-listing [\#1211](https://github.com/torrentpier/torrentpier/pull/1211) ([kovalensky](https://github.com/kovalensky), [belomaxorka](https://github.com/belomaxorka)) - Some reported bugfixes [\#1214](https://github.com/torrentpier/torrentpier/pull/1214) ([belomaxorka](https://github.com/belomaxorka)) -- Minor improvements [\#1215](https://github.com/torrentpier/torrentpier/pull/1215), [\#1217](https://github.com/torrentpier/torrentpier/pull/1217) ([belomaxorka](https://github.com/belomaxorka)) +- Minor improvements [\#1215](https://github.com/torrentpier/torrentpier/pull/1215), [\#1217](https://github.com/torrentpier/torrentpier/pull/1217), [\#1219](https://github.com/torrentpier/torrentpier/pull/1219) ([belomaxorka](https://github.com/belomaxorka)) - Fixed extensions issue [\#1218](https://github.com/torrentpier/torrentpier/pull/1218) ([belomaxorka](https://github.com/belomaxorka)) ## [v2.4.0-rc2](https://github.com/torrentpier/torrentpier/tree/v2.4.0-rc2) (2023-12-12) diff --git a/dl.php b/dl.php index 41f0cdf19..60ce0d0b2 100644 --- a/dl.php +++ b/dl.php @@ -186,8 +186,10 @@ if (!in_array($attachment['extension'], $allowed_extensions) && !IS_ADMIN) { } // Getting download mode by extension -if (!$download_mode = (int)$download_mode[$attachment['extension']]) { - bb_die('Incorrect download mode'); +if (isset($download_mode[$attachment['extension']])) { + $download_mode = intval($download_mode[$attachment['extension']]); +} else { + bb_die(sprintf($lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']) . '

' . $lang['FILENAME'] . ": " . $attachment['physical_filename']); } // Update download count