From afceb6327fa71e3d2bc296a88b3c9df328a31a09 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 20 Nov 2023 08:43:11 +0700 Subject: [PATCH] Normalizing announce-list (#337) * Normalizing announce-list * Update CHANGELOG.md --- CHANGELOG.md | 1 + library/includes/functions_torrent.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5242dcd8..4108efd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ **Merged pull requests:** - Release v2.1.5-2024.05-beta1 🎉 +- Normalizing announce-list [\#337](https://github.com/torrentpier/torrentpier-lts/pull/337) ([belomaxorka](https://github.com/belomaxorka)) - Fixed announcer-list issue [\#335](https://github.com/torrentpier/torrentpier-lts/pull/335), [\#336](https://github.com/torrentpier/torrentpier-lts/pull/336) ([belomaxorka](https://github.com/belomaxorka)) - Some other changes / improvements diff --git a/library/includes/functions_torrent.php b/library/includes/functions_torrent.php index 7d2a06bf..7becd26e 100644 --- a/library/includes/functions_torrent.php +++ b/library/includes/functions_torrent.php @@ -545,11 +545,17 @@ function send_torrent_with_passkey ($filename) } } - // Remove announce-list if empty + // Preparing announce-list if (empty($tor['announce-list'])) { + // Remove announce-list if empty unset($tor['announce-list']); } + else + { + // Normalizing announce-list + $tor['announce-list'] = array_unique($tor['announce-list'], SORT_REGULAR); + } // Add publisher & topic url $publisher_name = $bb_cfg['server_name'];