mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
misc: Minor improvements (#1904)
* misc: Minor improvements * Update legacy-changes.txt * Update composer.lock
This commit is contained in:
parent
19ef9efc6a
commit
3cdf843a04
3 changed files with 15 additions and 12 deletions
|
@ -605,11 +605,14 @@ function bt_show_ip($ip, $port = '')
|
|||
if (IS_AM) {
|
||||
$ip = \TorrentPier\Helpers\IPHelper::long2ip_extended($ip);
|
||||
|
||||
// Wrap IPv6 address in square brackets
|
||||
if ($port && str_contains($ip, ':')) {
|
||||
$ip = "[$ip]";
|
||||
if (!empty($port)) {
|
||||
if (\TorrentPier\Helpers\IPHelper::isValidv6($ip)) {
|
||||
// Wrap IPv6 address in square brackets
|
||||
$ip = "[$ip]:$port";
|
||||
} else {
|
||||
$ip = "$ip:$port";
|
||||
}
|
||||
}
|
||||
$ip .= $port ? ":$port" : '';
|
||||
|
||||
return $ip;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue