From f075dacd78f256114faffaa4265763a13c5a8ea5 Mon Sep 17 00:00:00 2001 From: David Gagnaire Date: Wed, 23 Aug 2023 12:18:00 +0200 Subject: [PATCH] Fix PHP 8.2 deprecated utf8_decode --- src/Client/ApiClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Client/ApiClient.php b/src/Client/ApiClient.php index 3b86b2cf..84a03d2d 100644 --- a/src/Client/ApiClient.php +++ b/src/Client/ApiClient.php @@ -487,7 +487,7 @@ public function generateAccessToken($client_id = null, $client_secret = null, $c $resourcePath = "/oauth/token"; $queryParams = []; - $integrator_and_secret_key = "Basic " . utf8_decode(base64_encode("{$client_id}:{$client_secret}")); + $integrator_and_secret_key = "Basic " . mb_convert_encoding(base64_encode("{$client_id}:{$client_secret}"), 'ISO-8859-1', 'UTF-8'); $headers = [ "Authorization" => $integrator_and_secret_key, "Content-Type" => "application/x-www-form-urlencoded", @@ -526,7 +526,7 @@ public function refreshAccessToken($client_id = null, $client_secret = null, $re } $resourcePath = "/oauth/token"; $queryParams = []; - $integrator_and_secret_key = "Basic " . utf8_decode(base64_encode("{$client_id}:{$client_secret}")); + $integrator_and_secret_key = "Basic " . mb_convert_encoding(base64_encode("{$client_id}:{$client_secret}"), 'ISO-8859-1', 'UTF-8'); $headers = [ "Authorization" => $integrator_and_secret_key, "Content-Type" => "application/x-www-form-urlencoded",