diff --git a/src/InputValues/JavascriptInputValue.php b/src/InputValues/JavascriptInputValue.php index a2f13f4..ab9f034 100644 --- a/src/InputValues/JavascriptInputValue.php +++ b/src/InputValues/JavascriptInputValue.php @@ -4,6 +4,7 @@ namespace Lukeraymonddowning\Honey\InputValues; +use Illuminate\Contracts\Encryption\DecryptException; use Illuminate\Support\Facades\Crypt; class JavascriptInputValue implements InputValue @@ -15,6 +16,10 @@ public function getValue(): string public function checkValue($value): bool { - return Crypt::decrypt($value) == "Honey"; + try { + return Crypt::decrypt($value) == "Honey"; + } catch (DecryptException) { + return false; + } } -} \ No newline at end of file +}