Skip to content

Commit

Permalink
Handling DecryptException in JavascriptInputValue
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedary authored Aug 24, 2023
1 parent f093e9b commit 7ff2282
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/InputValues/JavascriptInputValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
namespace Lukeraymonddowning\Honey\InputValues;


use Illuminate\Contracts\Encryption\DecryptException;
use Illuminate\Support\Facades\Crypt;

class JavascriptInputValue implements InputValue
Expand All @@ -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;
}
}
}
}

0 comments on commit 7ff2282

Please sign in to comment.