mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 22:33:55 -07:00
misc: Minor improvements
This commit is contained in:
parent
19ef9efc6a
commit
37b03e4489
1 changed files with 7 additions and 4 deletions
|
@ -605,11 +605,14 @@ function bt_show_ip($ip, $port = '')
|
||||||
if (IS_AM) {
|
if (IS_AM) {
|
||||||
$ip = \TorrentPier\Helpers\IPHelper::long2ip_extended($ip);
|
$ip = \TorrentPier\Helpers\IPHelper::long2ip_extended($ip);
|
||||||
|
|
||||||
|
if (!empty($port)) {
|
||||||
|
if (\TorrentPier\Helpers\IPHelper::isValidv6($ip)) {
|
||||||
// Wrap IPv6 address in square brackets
|
// Wrap IPv6 address in square brackets
|
||||||
if ($port && str_contains($ip, ':')) {
|
$ip = "[$ip]:$port";
|
||||||
$ip = "[$ip]";
|
} else {
|
||||||
|
$ip = "$ip:$port";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$ip .= $port ? ":$port" : '';
|
|
||||||
|
|
||||||
return $ip;
|
return $ip;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue