Skip to content

Commit

Permalink
check MCRYPT_RIJNDAEL_256 constant
Browse files Browse the repository at this point in the history
  • Loading branch information
yceruto committed Sep 12, 2019
1 parent ae4e7f9 commit 0b5680d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Encryptor/MCryptEncryptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ class MCryptEncryptor implements EncryptorInterface
/**
* {@inheritdoc}
*/
public function __construct($secretKey, $algorithm = MCRYPT_RIJNDAEL_256)
public function __construct($secretKey, $algorithm = null)
{
$this->algorithm = $algorithm;
$this->secretKey = $secretKey;

if (null === $algorithm && \defined('MCRYPT_RIJNDAEL_256')) {
$this->algorithm = MCRYPT_RIJNDAEL_256;
}
}

/**
Expand Down

0 comments on commit 0b5680d

Please sign in to comment.