mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Pass through crypto exceptions
This commit is contained in:
parent
865e34c0d0
commit
8c797aaba1
1 changed files with 2 additions and 9 deletions
|
|
@ -60,14 +60,7 @@ class Security
|
|||
// Use defuse/php-encryption if possible.
|
||||
if (!$force_compat && function_exists('openssl_encrypt'))
|
||||
{
|
||||
try
|
||||
{
|
||||
return base64_encode(\Crypto::Encrypt($plaintext, $key));
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return base64_encode(\Crypto::Encrypt($plaintext, $key));
|
||||
}
|
||||
|
||||
// Otherwise, use the CryptoCompat class.
|
||||
|
|
@ -102,7 +95,7 @@ class Security
|
|||
{
|
||||
return \Crypto::Decrypt($ciphertext, $key);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
catch (\InvalidCiphertextException $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue