mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
BUGFIX If $protector is not an object, create it
This commit is contained in:
parent
c2315c1618
commit
3c9b62645f
@ -46,7 +46,10 @@ class SpamProtectorManager {
|
||||
user_error("Spam Protector class '$protectorClass' does not exist. Please define a valid Spam Protector", E_USER_WARNING);
|
||||
}
|
||||
|
||||
$protector = new $protectorClass();
|
||||
if(!is_object($protector)) {
|
||||
$protector = new $protectorClass();
|
||||
}
|
||||
|
||||
try {
|
||||
$check = $protector->updateForm($form, $before, $fieldsToSpamServiceMapping);
|
||||
} catch (Exception $e) {
|
||||
|
Loading…
Reference in New Issue
Block a user