Refactor the encryption class.
This commit is contained in:
@@ -42,9 +42,7 @@ class Crypt {
|
|||||||
*/
|
*/
|
||||||
public static function decrypt($value)
|
public static function decrypt($value)
|
||||||
{
|
{
|
||||||
$value = base64_decode($value, true);
|
if ( ! is_string($value = base64_decode($value, true)))
|
||||||
|
|
||||||
if ( ! $value)
|
|
||||||
{
|
{
|
||||||
throw new \Exception('Decryption error. Input value is not valid base64 data.');
|
throw new \Exception('Decryption error. Input value is not valid base64 data.');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user