mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
BUGFIX: fixed spelling of spam protector module
This commit is contained in:
parent
928bb4bc6e
commit
8f9c0ba944
4
INSTALL
4
INSTALL
@ -21,7 +21,7 @@ SETTING UP THE MODULE (in 'mysite/_config.php')
|
|||||||
------------------------------------------------------
|
------------------------------------------------------
|
||||||
|
|
||||||
Before putting the following code in '_config.php', make sure you have a subclass of 'SpamProtectorField' installed or written. One
|
Before putting the following code in '_config.php', make sure you have a subclass of 'SpamProtectorField' installed or written. One
|
||||||
example of 'SpamProtecter' subclass is 'MollomField'.
|
example of 'SpamProtector' subclass is 'MollomField'.
|
||||||
|
|
||||||
<<<< CODE STARTS >>>>
|
<<<< CODE STARTS >>>>
|
||||||
|
|
||||||
@ -50,4 +50,4 @@ What does this do?
|
|||||||
|
|
||||||
This code add an instance of a 'SpamProtectorField' class specified in SETTING UP THE MODULE section. The newly created field will have
|
This code add an instance of a 'SpamProtectorField' class specified in SETTING UP THE MODULE section. The newly created field will have
|
||||||
MollomField field. The first parameter is a Form object in which the field will be added into and the second parameter tells
|
MollomField field. The first parameter is a Form object in which the field will be added into and the second parameter tells
|
||||||
SpamProtecterManagor to place the new field before a field named 'Message'.
|
SpamProtectorManagor to place the new field before a field named 'Message'.
|
||||||
|
@ -29,10 +29,10 @@ class SpamProtectorManager {
|
|||||||
* @param array an associative array
|
* @param array an associative array
|
||||||
* with the name of the spam web service's field, for example post_title, post_body, author_name
|
* with the name of the spam web service's field, for example post_title, post_body, author_name
|
||||||
* and a string of field names (seperated by comma) as a value.
|
* and a string of field names (seperated by comma) as a value.
|
||||||
* The naming of the fields is based on the implementation of the subclass of SpamProtecterField.
|
* The naming of the fields is based on the implementation of the subclass of SpamProtectorField.
|
||||||
* *** Most of the web service doesn't require this.
|
* *** Most of the web service doesn't require this.
|
||||||
* @return SpamProtector object on success or null if the spamprotecter class is not found
|
* @return SpamProtector object on success or null if the spamprotector class is not found
|
||||||
* also null if spamprotecterfield creation fails.
|
* also null if spamprotectorfield creation fails.
|
||||||
*/
|
*/
|
||||||
static function update_form($form, $before=null, $fieldsToSpamServiceMapping=null) {
|
static function update_form($form, $before=null, $fieldsToSpamServiceMapping=null) {
|
||||||
$check = null;
|
$check = null;
|
||||||
@ -41,9 +41,9 @@ class SpamProtectorManager {
|
|||||||
|
|
||||||
$protector = new $protectorClass();
|
$protector = new $protectorClass();
|
||||||
try {
|
try {
|
||||||
$check = $protecter->updateForm($form, $before, $fieldsToSpamServiceMapping);
|
$check = $protector->updateForm($form, $before, $fieldsToSpamServiceMapping);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
user_error("SpamProtecterManager::update_form(): '$protectorClass' is not correctly set up.", E_USER_WARNING);
|
user_error("SpamProtectorManager::update_form(): '$protectorClass' is not correctly set up.", E_USER_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$check) return null;
|
if(!$check) return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user