This fixes the issues with the newer pdns, which suddenly includes the whole API url in the returned json.

Closes . In response to 4d4e536d52
This commit is contained in:
Mark Schouten 2017-04-28 12:32:01 +02:00
parent 9d27a140d7
commit f67fa04d85

View file

@ -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();
} }
} }