mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-06-07 00:47:00 +03:00
Fixed from paulgiordanozethcon suggestion in https://github.com/tuxis-ie/nsedit/issues/162
This commit is contained in:
parent
ebd12ebeb2
commit
805176648d
2 changed files with 11 additions and 10 deletions
|
@ -29,11 +29,12 @@ class ApiHandler {
|
|||
private function apiurl() {
|
||||
$tmp = new ApiHandler();
|
||||
|
||||
$tmp->url = '/api';
|
||||
$tmp->url = '/api/v1/servers/localhost';
|
||||
$tmp->go();
|
||||
|
||||
if ($tmp->json[0]['version'] <= 1) {
|
||||
$this->apiurl = $tmp->json[0]['url'];
|
||||
$v = intval(substr($tmp->json["version"],0,1));
|
||||
if ($v == 4) {
|
||||
$this->apiurl = $tmp->json["url"];
|
||||
} else {
|
||||
throw new Exception("Unsupported API version");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue