Refactor the encryption class.

This commit is contained in:
Taylor Otwell
2011-08-08 13:14:50 -05:00
parent 4dc7f9448c
commit 8a175894b2

View File

@@ -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.');
} }