From d5b7a7c1546274bbb18deb5485b6723f4c71111a Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 20 Nov 2023 08:49:14 +0700 Subject: [PATCH] Normalizing announce-list (#1133) --- src/Legacy/Torrent.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Legacy/Torrent.php b/src/Legacy/Torrent.php index 45a3ee480..7259e4443 100644 --- a/src/Legacy/Torrent.php +++ b/src/Legacy/Torrent.php @@ -597,9 +597,13 @@ class Torrent } } - // 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