mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-04-18 19:59:30 +03:00
Merge pull request #204 from WilliamDEdwards/fix/ipv6-api-ip
Place brackets around IPv6 address
This commit is contained in:
commit
65d58cfd92
1 changed files with 7 additions and 1 deletions
|
@ -73,7 +73,13 @@ class ApiHandler {
|
|||
}
|
||||
|
||||
private function baseurl() {
|
||||
return $this->proto.'://'.$this->hostname.':'.$this->port.$this->apiurl;
|
||||
$ip = $this->hostname;
|
||||
|
||||
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||
$ip = sprintf('[%s]', $ip); // curl needs brackets for IPv6
|
||||
}
|
||||
|
||||
return $this->proto.'://'.$ip.':'.$this->port.$this->apiurl;
|
||||
}
|
||||
|
||||
private function go() {
|
||||
|
|
Loading…
Add table
Reference in a new issue