Skip to content

Commit 9fcc924

Browse files
author
Nara Kasbergen
committed
EncryptionProvider: substr -> mb_substr
1 parent 1815823 commit 9fcc924

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/One/Providers/EncryptionProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ public function decrypt($value)
8282

8383
$encrypted = base64_decode($value);
8484
$ivSize = openssl_cipher_iv_length($this->cipherMethod);
85-
$iv = substr($encrypted, 0, $ivSize);
86-
$encryptedText = substr($encrypted, $ivSize);
85+
$iv = mb_substr($encrypted, 0, $ivSize, '8bit');
86+
$encryptedText = mb_substr($encrypted, $ivSize, null, '8bit');
8787
$hashedSalt = openssl_digest($this->salt, 'sha256', true);
8888
$decryptedText = openssl_decrypt($encryptedText, $this->cipherMethod, $hashedSalt, OPENSSL_RAW_DATA, $iv);
8989

0 commit comments

Comments
 (0)