Skip to content

Commit 056acd6

Browse files
WPManageNinja#280 openssl decrypt warning issue fix
1 parent 7d81d81 commit 056acd6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/Functions/helpers.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,9 @@ function fluentMailEncryptDecrypt($value, $type = 'e') {
820820
$method = 'aes-256-ctr';
821821
$ivlen = openssl_cipher_iv_length($method);
822822
$iv = substr($raw_value, 0, $ivlen);
823+
if (strlen($iv) < 16) {
824+
$iv = str_pad($iv, 16, "\0"); // Pad with null bytes if it's shorter
825+
}
823826

824827
$raw_value = substr($raw_value, $ivlen);
825828

0 commit comments

Comments
 (0)