Skip to content

Commit

Permalink
Merge pull request #202 from buckaroo-it/BA-628-fix-utf8-encoding-in-…
Browse files Browse the repository at this point in the history
…base64data

BA-628 - Ensure consistent UTF-8 encoding in base64Data function to correct hash values
  • Loading branch information
vildanbina authored Nov 21, 2024
2 parents fab3fe3 + eb56e98 commit be51337
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Handlers/HMAC/Hmac.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ public function base64Data($data = null)
{
if (is_array($data))
{
$data = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION);
$data = mb_convert_encoding(
json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE),
'UTF-8',
'auto'
);
}

$md5 = md5($data, true);
Expand Down

0 comments on commit be51337

Please sign in to comment.