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