2010-12-13 01:50:08 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2014-02-10 08:53:59 +01:00
|
|
|
* Apply the spam protection to the comments module if it is installed.
|
2010-12-13 01:50:08 +01:00
|
|
|
*
|
|
|
|
* @package spamprotection
|
|
|
|
*/
|
|
|
|
|
|
|
|
class CommentSpamProtection extends Extension {
|
|
|
|
|
2012-12-15 23:23:21 +01:00
|
|
|
public function alterCommentForm(&$form) {
|
2014-02-10 08:53:59 +01:00
|
|
|
$form->enableSpamProtection(array(
|
|
|
|
'mapping' => array(
|
|
|
|
'Name' => 'authorName',
|
|
|
|
'Email' => 'authorEmail',
|
|
|
|
'URL' => 'authorUrl',
|
|
|
|
'Comment' => 'body',
|
|
|
|
'ReturnURL' => 'contextUrl'
|
|
|
|
),
|
|
|
|
'checks' => array(
|
|
|
|
'spam',
|
|
|
|
'profanity'
|
|
|
|
)
|
2010-12-13 01:50:08 +01:00
|
|
|
));
|
|
|
|
}
|
2013-04-10 04:52:08 +02:00
|
|
|
}
|