mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
BUGFIX: return false when there's no spam protector class has been specified
This commit is contained in:
parent
5ac128830b
commit
1c902a19e7
@ -48,7 +48,7 @@ class SpamProtectorManager {
|
|||||||
$protectorClass = self::get_spam_protector();
|
$protectorClass = self::get_spam_protector();
|
||||||
|
|
||||||
// Don't update if no protector is set
|
// Don't update if no protector is set
|
||||||
if(!$protectorClass) return;
|
if(!$protectorClass) return false;
|
||||||
|
|
||||||
if(!class_exists($protectorClass)) {
|
if(!class_exists($protectorClass)) {
|
||||||
return user_error("Spam Protector class '$protectorClass' does not exist. Please define a valid Spam Protector", E_USER_WARNING);
|
return user_error("Spam Protector class '$protectorClass' does not exist. Please define a valid Spam Protector", E_USER_WARNING);
|
||||||
@ -85,7 +85,11 @@ class SpamProtectorManager {
|
|||||||
* @param String Feedback on the $object usually 'spam' or 'ham' for non spam entries
|
* @param String Feedback on the $object usually 'spam' or 'ham' for non spam entries
|
||||||
*/
|
*/
|
||||||
static function send_feedback($object, $feedback) {
|
static function send_feedback($object, $feedback) {
|
||||||
$protector = new self::$spam_protector();
|
$protectorClass = self::get_spam_protector();
|
||||||
|
|
||||||
|
if(!$protectorClass) return false;
|
||||||
|
|
||||||
|
$protector = new $protectorClass();
|
||||||
return $protector->sendFeedback($object, $feedback);
|
return $protector->sendFeedback($object, $feedback);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user