Skip to content

Commit

Permalink
WPManageNinja#280 openssl decrypt warning issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hasanuzzamanbe committed Feb 16, 2025
1 parent 7d81d81 commit 056acd6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/Functions/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,9 @@ function fluentMailEncryptDecrypt($value, $type = 'e') {
$method = 'aes-256-ctr';
$ivlen = openssl_cipher_iv_length($method);
$iv = substr($raw_value, 0, $ivlen);
if (strlen($iv) < 16) {
$iv = str_pad($iv, 16, "\0"); // Pad with null bytes if it's shorter
}

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

Expand Down

0 comments on commit 056acd6

Please sign in to comment.