Skip to content

Commit

Permalink
Merge pull request #65 from crayon1337/crayon1337-patch-1
Browse files Browse the repository at this point in the history
fix: Handling DecryptException in JavascriptInputValue
  • Loading branch information
lukeraymonddowning committed Feb 21, 2024
2 parents f093e9b + 7ff2282 commit 193de5a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/InputValues/JavascriptInputValue.php
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 193de5a

Please sign in to comment.