<commit_before><?php namespace Msurguy\Honeypot;

use Illuminate\Support\Facades\Crypt;

class HoneytimeValidator {

    /**
     * Extending Laravel Validator (http://laravel.com/docs/validation#custom-validation-rules)
     */
    public function validate($attribute, $value, $parameters, $validator)
    {
        $value = Crypt::decrypt($value);

        // The current time should be greater than the time the form was built + the speed option
        return ( is_numeric($value) && time() > ($value + $parameters[0]) );
    }

}
<commit_msg>Catch Decrypt Exception<commit_after><?php namespace Msurguy\Honeypot;

use Illuminate\Support\Facades\Crypt;

class HoneytimeValidator {

    /**
     * Extending Laravel Validator (http://laravel.com/docs/validation#custom-validation-rules)
     */
    public function validate($attribute, $value, $parameters, $validator)
    {
        // Laravel will throw an uncaught exception if the value is empty
        // We will try and catch it to make it easier on users.
        try
        {
          $value = Crypt::decrypt($value);   
        }
        catch (\Illuminate\Encryption\DecryptException $exception){
            return false;
        }

        // The current time should be greater than the time the form was built + the speed option
        return ( is_numeric($value) && time() > ($value + $parameters[0]) );
    }

}

{'fraction_non_alphanumeric': 0.11279826464208242, 'fraction_numerical': 0.0014461315979754157, 'mean_word_length': 2.760869565217391, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '359514', 'n_tokens_mistral': 386, 'n_tokens_neox': 385, 'n_words': 111}