diff --git a/src/Encryption/Encryptor.php b/src/Encryption/Encryptor.php index fa6c2b724..d8da47224 100644 --- a/src/Encryption/Encryptor.php +++ b/src/Encryption/Encryptor.php @@ -210,10 +210,14 @@ public function decode($decrypted) */ protected function getAESKey() { - if (empty($this->AESKey) || strlen($this->AESKey) !== 43) { + if (empty($this->AESKey)) { throw new InvalidConfigException("Configuration mission, 'aes_key' is required."); } + if (strlen($this->AESKey) !== 43) { + throw new InvalidConfigException("The length of 'aes_key' must be 43."); + } + return base64_decode($this->AESKey.'=', true); }