-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from itk-dev/feature/SUPP0RT-1165-honeypot-ajax
SUPP0RT-1165: Added patch fixing honeypot and ajax clash
- Loading branch information
Showing
4 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/src/HoneypotService.php b/src/HoneypotService.php | ||
index 1eeb6df..9a6f3a3 100644 | ||
--- a/src/HoneypotService.php | ||
+++ b/src/HoneypotService.php | ||
@@ -329,6 +329,12 @@ class HoneypotService implements HoneypotServiceInterface { | ||
return; | ||
} | ||
|
||
+ // If the triggering element is using ajax behaviour | ||
+ // then skip time restriction validation. | ||
+ if (isset($triggering_element['#ajax'])) { | ||
+ return; | ||
+ } | ||
+ | ||
// Get the time value. | ||
$identifier = $form_state->getValue('honeypot_time', FALSE); | ||
$honeypot_time = $this->keyValue->get($identifier, 0); |