Fix IPv6 handling

This commit is contained in:
cytopia 2022-12-25 18:11:25 +01:00
parent 10571f7b51
commit 025b45c48c
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2

View File

@ -214,11 +214,10 @@ class Httpd extends BaseClass implements BaseInterface
$type = $arr[1];
$prot = $arr[2];
$addr = '';
$addr = ''; // this may contain ':' itself due to IPv6 addresses
for ($i=3; $i<(count($arr)-1); $i++) {
$addr .= $arr[$i];
}
$addr = $arr[3]; // this may contain ':' itself
$port = $arr[count($arr) - 1];
return $prot.'://'.$addr.':'.$port;