diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2021-02-25 18:04:38 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2021-02-25 18:04:38 +0300 |
commit | 6ed0e6e9cf781f0be7601690f342098d79ab220c (patch) | |
tree | 3125b7b4be3c84bbc3ed49db2cf9c2eb02d1f290 | |
parent | b75f1a4ab828e54f329b2191673ca4b64c953dae (diff) |
fix
-rw-r--r-- | FastDNS.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/FastDNS.php b/FastDNS.php index bd2ab66..f7c9736 100644 --- a/FastDNS.php +++ b/FastDNS.php @@ -28,7 +28,7 @@ class FastDNS { $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); - $response = jsonDecode($body); + $response = json_decode($body, true); if ($code != 200) throw new FastDNSException($response['message'], $response['code']); @@ -274,7 +274,7 @@ class FastDNS { if (!empty($params)) { if ($method === 'POST' || $method == 'PUT') { curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); - curl_setopt($ch, CURLOPT_POSTFIELDS, jsonEncode($params)); + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); } else if ($method === 'GET') { // Probably never used $url .= '?'.http_build_query($params); } @@ -288,7 +288,7 @@ class FastDNS { $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); - $response = jsonDecode($body); + $response = json_decode($body, true); if ($code >= 400) { if (!empty($response['code']) && !empty($response['message'])) { $message = $response['message']; |