Skip to content

Commit 6d67159

Browse files
author
Igor Kuburovic
committed
TSMD-23137 fixed deprecated function utf8_encode
1 parent 3f78b87 commit 6d67159

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

RELEASE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
3.0.2
2+
- Fixed deprecated function utf8_encode() in RestClient.php, changed it with mb_convert_encoding()
3+
14
3.0.1
25
- Updated to fix support for PHP 8+
36

src/rest/RestClient.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static function generateTelesignHeaders (
121121
$string_to_sign = join("", $string_to_sign_builder);
122122

123123
$signature = base64_encode(
124-
hash_hmac("sha256", utf8_encode($string_to_sign), base64_decode($api_key), true)
124+
hash_hmac("sha256", mb_convert_encoding($string_to_sign, "UTF-8", mb_detect_encoding($string_to_sign)), base64_decode($api_key), true)
125125
);
126126
$authorization = "TSA $customer_id:$signature";
127127

@@ -208,7 +208,6 @@ function delete (...$args) {
208208
*/
209209
protected function execute ($method_name, $resource, $fields = [], $date = null, $nonce = null) {
210210
$url_encoded_fields = http_build_query($fields, "", "&");
211-
212211
$headers = $this->generateTelesignHeaders(
213212
$this->customer_id,
214213
$this->api_key,

src/version/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
namespace telesign\sdk\version;
44

5-
const VERSION = "v3.0.1";
5+
const VERSION = "v3.0.2";

0 commit comments

Comments
 (0)