From 6ed0e6e9cf781f0be7601690f342098d79ab220c Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Thu, 25 Feb 2021 18:04:38 +0300 Subject: fix --- FastDNS.php | 6 +++--- 1 file 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']; -- cgit v1.2.3