From 23456902e3f2476072fda072d9651cf8172964e9 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 31 Dec 2023 15:28:45 +0700 Subject: [PATCH] Minor improvements (#1301) * Minor improvements * Update filelist.php --- README.md | 7 +++---- filelist.php | 14 +++++++------- robots.txt | 3 ++- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index ef041217a..9149a9e9b 100644 --- a/README.md +++ b/README.md @@ -55,14 +55,13 @@ For installation, you need to follow a few simple steps: 3. After run `composer install` on the project directory 4. Create database and import dump located at **install/sql/mysql.sql** 5. Edit database configuration settings in the configuration file or a local copy (see below) -6. Edit domain name in the configuration file or a local copy (see below) -7. Edit domain ssl setting in the configuration file or a local copy (see below) -8. Edit this files: +6. Edit domain name in the configuration file or a local copy (`$reserved_name` and `$reserved_port`) +7. Edit this files: 1. **favicon.png** (change on your own) 2. **robots.txt** (change the addresses in lines **Host** and **Sitemap** on your own) 3. **opensearch_desc.xml** (change the description and address on your own) 4. **opensearch_desc_bt.xml** (change the description and address on your own) -9. Log in to the forum with admin/admin login/password and finish setting up via admin panel +8. Log in to the forum with admin/admin login/password and finish setting up via admin panel ## 🔑 Access rights on folders and files diff --git a/filelist.php b/filelist.php index 0fb88e814..27634e1e1 100644 --- a/filelist.php +++ b/filelist.php @@ -14,7 +14,7 @@ $user->session_start(); if ($bb_cfg['bt_disable_dht'] && IS_GUEST) { http_response_code(403); - die($lang['BT_PRIVATE_TRACKER']); + bb_simple_die($lang['BT_PRIVATE_TRACKER']); } $topic_id = !empty($_GET['topic']) ? (int)$_GET['topic'] : (http_response_code(404) && die($lang['INVALID_TOPIC_ID'])); @@ -30,19 +30,19 @@ $row = DB()->fetch_row($sql); if (empty($row) || empty($row['physical_filename'])) { http_response_code(404); - die($lang['TOPIC_POST_NOT_EXIST']); + bb_simple_die($lang['TOPIC_POST_NOT_EXIST']); } if (empty($row['info_hash_v2'])) { http_response_code(410); - die($lang['BT_V2_FLIST_ONLY']); + bb_simple_die($lang['BT_V2_FLIST_ONLY']); } $file_path = get_attachments_dir() . '/' . $row['physical_filename']; if (!is_file($file_path)) { http_response_code(410); - die($lang['TOR_NOT_FOUND']); + bb_simple_die($lang['TOR_NOT_FOUND']); } $file_contents = file_get_contents($file_path); @@ -54,7 +54,7 @@ if ($bb_cfg['flist_max_files']) { if ($file_count > $bb_cfg['flist_max_files']) { http_response_code(410); - die(sprintf($lang['BT_V2_FLIST_LIMIT'], $bb_cfg['flist_max_files'], $file_count)); + bb_simple_die(sprintf($lang['BT_V2_FLIST_LIMIT'], $bb_cfg['flist_max_files'], $file_count)); } } @@ -62,12 +62,12 @@ try { $torrent = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY); } catch (\Exception $e) { http_response_code(410); - die(htmlCHR("{$lang['TORFILE_INVALID']}: {$e->getMessage()}")); + bb_simple_die(htmlCHR("{$lang['TORFILE_INVALID']}: {$e->getMessage()}")); } if (isset($torrent['info']['private']) && IS_GUEST) { http_response_code(403); - die($lang['BT_PRIVATE_TORRENT']); + bb_simple_die($lang['BT_PRIVATE_TORRENT']); } $files = (new TorrentPier\Legacy\TorrentFileList($torrent))->fileTreeTable($torrent['info']['file tree']); diff --git a/robots.txt b/robots.txt index d72f95ae7..906545ca4 100644 --- a/robots.txt +++ b/robots.txt @@ -1,4 +1,5 @@ User-agent: * + Disallow: /bt/* Disallow: /dl.php Disallow: /group.php @@ -10,4 +11,4 @@ Disallow: /privmsg.php Disallow: /profile.php Host: torrentpier.com -Sitemap: http://torrentpier.com/sitemap.xml +Sitemap: http://torrentpier.com/sitemap/sitemap.xml