mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
BUGFIX Don't try to instanciate new SpamProtector instances if none is set in SpamProtectorManager::update_form()
This commit is contained in:
parent
78038e14ca
commit
5ac128830b
@ -47,6 +47,9 @@ class SpamProtectorManager {
|
||||
static function update_form($form, $before = null, $fieldsToSpamServiceMapping = array(), $title = null, $rightTitle = null) {
|
||||
$protectorClass = self::get_spam_protector();
|
||||
|
||||
// Don't update if no protector is set
|
||||
if(!$protectorClass) return;
|
||||
|
||||
if(!class_exists($protectorClass)) {
|
||||
return user_error("Spam Protector class '$protectorClass' does not exist. Please define a valid Spam Protector", E_USER_WARNING);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user