From cf250cd7ee3e946e840b262cf5d2302a184b517b Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 29 Aug 2023 19:55:46 +0300 Subject: [PATCH] auto-append TRACKER_LINKS to download link, make attribute values unique --- src/public/action.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/public/action.php b/src/public/action.php index 5cb5d76..8dcc207 100644 --- a/src/public/action.php +++ b/src/public/action.php @@ -414,6 +414,11 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false) $uri->value))); } + foreach (TRACKER_LINKS as $tracker => $value) + { + $link[] = sprintf('tr=%s', urlencode($value->announce)); + } + /// Acceptable Source foreach ($db->findAcceptableSourceByMagnetId($magnet->magnetId) as $result) { @@ -452,7 +457,7 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false) // Return download link header( - sprintf('Location: %s', implode('&', $link)) + sprintf('Location: %s', implode('&', array_unique($link))) ); }