mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
29 lines
657 B
PHP
29 lines
657 B
PHP
<?php
|
|
|
|
/**
|
|
* Apply the spam protection to the comments module if it is installed.
|
|
*
|
|
* @package spamprotection
|
|
*/
|
|
|
|
class CommentSpamProtection extends Extension
|
|
{
|
|
public function alterCommentForm(&$form)
|
|
{
|
|
$form->enableSpamProtection(array(
|
|
'name' => 'IsSpam',
|
|
'mapping' => array(
|
|
'Name' => 'authorName',
|
|
'Email' => 'authorEmail',
|
|
'URL' => 'authorUrl',
|
|
'Comment' => 'body',
|
|
'ReturnURL' => 'contextUrl'
|
|
),
|
|
'checks' => array(
|
|
'spam',
|
|
'profanity'
|
|
)
|
|
));
|
|
}
|
|
}
|