Skip to content

Commit

Permalink
TOURCMS-10437 Replace utf8_encode deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
palisis-juanra committed Sep 5, 2024
1 parent db1d133 commit 5951305
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/TourCMS.php
Original file line number Diff line number Diff line change
Expand Up @@ -911,12 +911,10 @@ protected function validateParams($params)
* @param $channel Channel ID
* @return String
*/
protected function generate_signature($path, $verb, $channel, $outbound_time) {

protected function generate_signature($path, $verb, $channel, $outbound_time)
{
$string_to_sign = trim($channel."/".$this->marketp_id."/".$verb."/".$outbound_time.$path);

$signature = rawurlencode(base64_encode((hash_hmac("sha256", utf8_encode($string_to_sign), $this->private_key, TRUE ))));

$signature = rawurlencode(base64_encode((hash_hmac("sha256", mb_convert_encoding($string_to_sign, 'UTF-8', 'ISO-8859-1'), $this->private_key, TRUE ))));
return $signature;
}

Expand Down

0 comments on commit 5951305

Please sign in to comment.