Skip to content

Commit 12151b9

Browse files
authored
Merge pull request #27 from SAP/rem_utf8_encode_php82
Removed utf8 encode deprecated in PHP 8.2
2 parents f5b4048 + 111695e commit 12151b9

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The PHP SDK, provides a PHP interface for the Gigya API.
66
The library makes it simple to integrate Gigya services in your PHP application.
77

88
## Requirements
9-
[PHP 7.x.](https://www.php.net/downloads) , [PHP 8.1](https://www.php.net/downloads)
9+
[PHP 8.0.x, PHP 8.1.x, PHP 8.2.x](https://www.php.net/downloads)
1010

1111
## Download and Installation
1212
### Standalone

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
"version": "3.0.3",
66
"license": "Apache-2.0",
77
"require": {
8-
"php": ">=8.0 <8.2",
8+
"php": ">=8.0",
99
"firebase/php-jwt": "^6.0",
1010
"ext-json": "*",
1111
"ext-curl": "*",
12-
"ext-openssl": "*"
12+
"ext-openssl": "*",
13+
"ext-mbstring": "*"
1314
},
1415
"require-dev": {
1516
"phpunit/phpunit": "^8.5"

src/SigUtils.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ public static function getDynamicSessionSignatureUserSigned($glt_cookie, $timeou
5858

5959
static function calcSignature($baseString, $key)
6060
{
61-
$baseString = utf8_encode($baseString);
62-
$rawHmac = hash_hmac("sha1", utf8_encode($baseString), base64_decode($key), true);
61+
$baseString = mb_convert_encoding($baseString, 'UTF-8', mb_list_encodings());
62+
$rawHmac = hash_hmac("sha1", $baseString, base64_decode($key), true);
6363

6464
return base64_encode($rawHmac);
6565
}
66-
}
66+
}

0 commit comments

Comments
 (0)