From bf2a8e130eadcffbe97288458989f4f3a43e60e7 Mon Sep 17 00:00:00 2001 From: Seobs Date: Wed, 22 Feb 2023 12:15:33 +0900 Subject: [PATCH 1/2] Fix deprecated in php8.2 - Dynamic Properties - utf8_encode --- composer.json | 1 + src/SensAlimtalk.php | 4 ++-- src/SensAlimtalkMessage.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index c6555e9..034bbb9 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,7 @@ "require": { "php": ">=7.2", "ext-json": "*", + "ext-mbstring": "*", "guzzlehttp/guzzle": "^6.0|^7.0", "illuminate/notifications": "~6.0 || ~7.0 || ~8.0 || ~9.0", "illuminate/support": "~6.0 || ~7.0 || ~8.0 || ~9.0" diff --git a/src/SensAlimtalk.php b/src/SensAlimtalk.php index 3417f12..4558d62 100644 --- a/src/SensAlimtalk.php +++ b/src/SensAlimtalk.php @@ -42,8 +42,8 @@ private function signature() : string $buffer[] = strtoupper($this->method) . ' ' . $this->targetURL; $buffer[] = $this->timestamp; $buffer[] = $this->accessKey; - $secretKey = utf8_encode($this->secretKey); - $message = utf8_encode(implode("\n", $buffer)); + $secretKey = mb_convert_encoding($this->secretKey, 'UTF-8', mb_list_encodings()); + $message = mb_convert_encoding(implode("\n", $buffer), 'UTF-8', mb_list_encodings()); $hash = hex2bin(hash_hmac('sha256', $message, $secretKey)); return base64_encode($hash); diff --git a/src/SensAlimtalkMessage.php b/src/SensAlimtalkMessage.php index aa59ef1..b686c9e 100644 --- a/src/SensAlimtalkMessage.php +++ b/src/SensAlimtalkMessage.php @@ -18,6 +18,7 @@ class SensAlimtalkMessage public $variables; public $utmSource; public $custom_pattern = '/#{\w.+}/'; + public $messages = []; /** * SensAlimtalkMessage constructor. @@ -26,7 +27,6 @@ public function __construct() { $this->plusFriendId = config('sens-alimtalk.plus_friend_id'); $this->countryCode = '+82'; - $this->messages = []; } /** From febfd1d7763241b880ef11e688b859b14234cebc Mon Sep 17 00:00:00 2001 From: Seobs Date: Tue, 28 Nov 2023 17:45:40 +0900 Subject: [PATCH 2/2] Support laravel 10 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 034bbb9..2c01923 100644 --- a/composer.json +++ b/composer.json @@ -19,11 +19,11 @@ "ext-json": "*", "ext-mbstring": "*", "guzzlehttp/guzzle": "^6.0|^7.0", - "illuminate/notifications": "~6.0 || ~7.0 || ~8.0 || ~9.0", - "illuminate/support": "~6.0 || ~7.0 || ~8.0 || ~9.0" + "illuminate/notifications": "~6.0 || ~7.0 || ~8.0 || ~9.0 || ~10.0", + "illuminate/support": "~6.0 || ~7.0 || ~8.0 || ~9.0 || ~10.0" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.0 || ^10.0" }, "autoload": { "psr-4": {