Skip to content

Commit

Permalink
Delete expired records using setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Croker committed Mar 28, 2021
1 parent 133c1df commit ac5c901
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Changed the minimum requirement of Craft to version 3.2.1.
- Renamed “Blacklist” to “Deny List”, a list of IP addresses that will always be denied.
- The hidden input field now has an `autocomplete` attribute set to `off`.
- IP addresses are now stored as anonymous hash values.

### Removed
- Removed the “Excluded URI Patterns” setting. Use the new “Exclude Controller Actions” setting instead.
Expand Down
2 changes: 1 addition & 1 deletion src/services/SnaptchaService.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public function validateField(string $value = null): bool

// Delete all expired records
SnaptchaRecord::deleteAll([
'<', 'timestamp', time() - ($record->expirationTime * 60)
'<', 'timestamp', time() - (Snaptcha::$plugin->settings->expirationTime * 60)
]);

// Fire an after event
Expand Down

0 comments on commit ac5c901

Please sign in to comment.