From ea358eb371e1cfdfc2be6019f384c9424b96ba27 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sun, 19 Feb 2012 22:56:59 -0600 Subject: [PATCH] cleaning up code. --- laravel/crypter.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/laravel/crypter.php b/laravel/crypter.php index c58c6b3a..f5113f34 100644 --- a/laravel/crypter.php +++ b/laravel/crypter.php @@ -141,7 +141,13 @@ protected static function unpad($value) return substr($value, 0, $length - $pad); } - throw new \Exception("Decryption error. Padding is invalid."); + // If the padding characters do not match the expected padding + // for the value we'll bomb out with an exception since the + // encrypted value seems to have been changed. + else + { + throw new \Exception("Decryption error. Padding is invalid."); + } } return $value;