From 72d677588b1a6d047d83abd7c9ea5431383a4d54 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sat, 16 Dec 2023 13:18:27 +0700 Subject: [PATCH] Update dl.php --- dl.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dl.php b/dl.php index ab8d5bc2..57459824 100644 --- a/dl.php +++ b/dl.php @@ -107,6 +107,12 @@ if (!($attachment = DB()->sql_fetchrow($result))) $attachment['physical_filename'] = basename($attachment['physical_filename']); +// Re-define download mode for thumbnails +if ($thumbnail) +{ + $attachment['physical_filename'] = THUMB_DIR . '/t_' . $attachment['physical_filename']; +} + DB()->sql_freeresult($result); // get forum_id for attachment authorization or private message authorization @@ -201,16 +207,12 @@ if (!in_array($attachment['extension'], $allowed_extensions)) bb_die(sprintf($lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']) . "

" . $lang['FILENAME'] . ": " . $attachment['physical_filename']); } +// Getting download mode by extension if (!$download_mode = intval($download_mode[$attachment['extension']])) { bb_die('Incorrect download mode'); } -if ($thumbnail) -{ - $attachment['physical_filename'] = THUMB_DIR . '/t_' . $attachment['physical_filename']; -} - // Update download count if (!$thumbnail) {