mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-04-27 21:09:43 +03:00
This fixes the issues with the newer pdns, which suddenly includes the whole API url in the returned json.
Closes #145. In response to 4d4e536d52
This commit is contained in:
parent
9d27a140d7
commit
f67fa04d85
1 changed files with 4 additions and 12 deletions
|
@ -91,15 +91,8 @@ class ApiHandler {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->url = str_replace($this->apiurl, '', $this->url);
|
|
||||||
curl_setopt($this->curlh, CURLOPT_URL, $this->baseurl().$this->url);
|
curl_setopt($this->curlh, CURLOPT_URL, $this->baseurl().$this->url);
|
||||||
|
|
||||||
//print "Here we go:\n";
|
|
||||||
//print "Request: ".$this->method.' '.$this->baseurl().$this->url."\n";
|
|
||||||
//if ($this->content != '') {
|
|
||||||
// print "Content: ".$this->content."\n";
|
|
||||||
//}
|
|
||||||
|
|
||||||
$return = curl_exec($this->curlh);
|
$return = curl_exec($this->curlh);
|
||||||
$code = curl_getinfo($this->curlh, CURLINFO_HTTP_CODE);
|
$code = curl_getinfo($this->curlh, CURLINFO_HTTP_CODE);
|
||||||
$json = json_decode($return, 1);
|
$json = json_decode($return, 1);
|
||||||
|
@ -117,12 +110,11 @@ class ApiHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function call() {
|
public function call() {
|
||||||
if (substr($this->url, 0, 1) == '/') {
|
if (substr($this->url, 0, 1) != '/') {
|
||||||
$this->apiurl();
|
$this->url = '/'.$this->url;
|
||||||
} else {
|
|
||||||
$this->apiurl = '/';
|
|
||||||
}
|
}
|
||||||
|
$this->apiurl();
|
||||||
|
$this->url = str_replace($this->apiurl, '', $this->url);
|
||||||
$this->go();
|
$this->go();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue