-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8357015
commit 5afed61
Showing
2 changed files
with
33 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
name: frameworktest-spamprotection | ||
--- | ||
SilverStripe\SpamProtection\Extension\FormSpamProtectionExtension: | ||
default_spam_protector: SilverStripe\FrameworkTest\NullSpamProtector\NullSpamProtector |
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,28 @@ | ||
<?php | ||
|
||
namespace SilverStripe\FrameworkTest\NullSpamProtector; | ||
|
||
use SilverStripe\Forms\HiddenField; | ||
use SilverStripe\SpamProtection\SpamProtector; | ||
|
||
if (!interface_exists(SpamProtector::class)) { | ||
return; | ||
} | ||
|
||
/** | ||
* This is a minimum implementation used in CI for silverstripe/spamprotector so there's a default_spam_protector | ||
* | ||
* This used to be done by silverstripe/akismet, but that's no longer being used in CMS 5 | ||
*/ | ||
class NullSpamProtector implements SpamProtector | ||
{ | ||
public function getFormField($name = null, $title = null, $value = null) | ||
{ | ||
return new HiddenField('NullSpamProtector'); | ||
} | ||
|
||
public function setFieldMapping($fieldMapping) | ||
{ | ||
// no-op | ||
} | ||
} |