Refactor the encryption class.
This commit is contained in:
parent
4dc7f9448c
commit
8a175894b2
|
@ -42,9 +42,7 @@ public static function encrypt($value)
|
||||||
*/
|
*/
|
||||||
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.');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue