From 8a175894b260684b56e110a3b1cd540064de2690 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 8 Aug 2011 13:14:50 -0500 Subject: [PATCH] Refactor the encryption class. --- system/crypt.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/system/crypt.php b/system/crypt.php index 93367060..e3965751 100644 --- a/system/crypt.php +++ b/system/crypt.php @@ -42,9 +42,7 @@ public static function encrypt($value) */ public static function decrypt($value) { - $value = base64_decode($value, true); - - if ( ! $value) + if ( ! is_string($value = base64_decode($value, true))) { throw new \Exception('Decryption error. Input value is not valid base64 data.'); }