mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-04-19 20:09:14 +03:00
Only add brackets for IPv6
This commit is contained in:
parent
ff2a224d4f
commit
6249c099a9
1 changed files with 7 additions and 1 deletions
|
@ -60,7 +60,13 @@ class ApiHandler {
|
|||
}
|
||||
|
||||
private function baseurl() {
|
||||
return $this->proto.'://['.$this->hostname.']:'.$this->port.$this->apiurl;
|
||||
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||
$ip = sprintf('[%s]', $this->hostname); // curl needs brackets for IPv6
|
||||
} else {
|
||||
$ip = $this->hostname;
|
||||
}
|
||||
|
||||
return $this->proto.'://'.$ip.':'.$this->port.$this->apiurl;
|
||||
}
|
||||
|
||||
private function go() {
|
||||
|
|
Loading…
Add table
Reference in a new issue