Skip to content

Commit

Permalink
Fix compression argument passing to compress message
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyen Van Nguyen <nguyennv1981@gmail.com>
  • Loading branch information
nguyennv committed Jan 13, 2025
1 parent 337dcac commit afac787
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/OpenPGP.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,9 @@ public static function encrypt(
): Type\EncryptedMessageInterface
{
return empty($signingKeys) ?
$message->compress($compression)->encrypt(
$message->compress(
$compression ?? Common\Config::getPreferredCompression()
)->encrypt(
$encryptionKeys,
$passwords,
$symmetric ?? Common\Config::getPreferredSymmetric()
Expand All @@ -483,7 +485,9 @@ public static function encrypt(
),
$notationData,
$time
)->compress($compression)->encrypt(
)->compress(
$compression ?? Common\Config::getPreferredCompression()
)->encrypt(
$encryptionKeys,
$passwords,
$symmetric ?? Common\Config::getPreferredSymmetric()
Expand Down

0 comments on commit afac787

Please sign in to comment.