Fix not working code (#1087)

This commit is contained in:
Cønstantine Kovalensky 2023-11-12 22:06:05 +04:00 committed by GitHub
commit 4b397efb9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View file

@ -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<br>") : "$n. " . get_user_torrent_client($client) . " => $value<br>";
$client_list .= ($client_full) ? ("$client => $value<br>") : "$n. " . get_user_torrent_client($client) . " $value<br>";
$n++;
}

View file

@ -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 '<img width="auto" height="auto" style="display: inline !important; vertical-align: middle;" src="' . $clientIconPath . '" alt="' . $bestMatch . '" title="' . $peerId . '">';
} else {
return $bestMatch;
}
if (!empty($bestMatch)) {
return '<img width="auto" height="auto" style="display:inline!important;vertical-align:middle" src="/styles/images/clients/'. $bestMatch . $iconExtension . '" alt="' . $bestMatch . '" title="' . $peerId . '">';
}
return $peerId;