From 4b397efb9aabe2667e37c6109ff97b94a6138539 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B8nstantine=20Kovalensky?=
<45331093+kovalensky@users.noreply.github.com>
Date: Sun, 12 Nov 2023 22:06:05 +0400
Subject: [PATCH] Fix not working code (#1087)
---
admin/stats/tracker.php | 2 +-
library/includes/functions.php | 9 ++-------
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/admin/stats/tracker.php b/admin/stats/tracker.php
index cb46bbfb3..246508337 100644
--- a/admin/stats/tracker.php
+++ b/admin/stats/tracker.php
@@ -117,7 +117,7 @@ if ($client_full || !$stats_cache = CACHE('tr_cache')->get('tracker_clients_stat
$n = 1;
foreach (array_slice($clients_percentage, 0, $numwant) as $client => $value) {
- $client_list .= ($client_full) ? ("$client => $value
") : "$n. " . get_user_torrent_client($client) . " => $value
";
+ $client_list .= ($client_full) ? ("$client => $value
") : "$n. " . get_user_torrent_client($client) . " $value
";
$n++;
}
diff --git a/library/includes/functions.php b/library/includes/functions.php
index 3bd242db5..dc9a56b92 100644
--- a/library/includes/functions.php
+++ b/library/includes/functions.php
@@ -1236,13 +1236,8 @@ function get_user_torrent_client(string $peerId): mixed
}
}
- if (!empty($bestMatchLength) && !empty($bestMatch)) {
- $clientIconPath = 'styles/images/clients/' . $bestMatch . $iconExtension;
- if (is_file($clientIconPath)) {
- return '
';
- } else {
- return $bestMatch;
- }
+ if (!empty($bestMatch)) {
+ return '
';
}
return $peerId;