From 1c902a19e77c16c69da076526e9558894411d49f Mon Sep 17 00:00:00 2001 From: Saophalkun Ponlu Date: Tue, 2 Feb 2010 03:04:52 +0000 Subject: [PATCH] BUGFIX: return false when there's no spam protector class has been specified --- code/SpamProtectorManager.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/SpamProtectorManager.php b/code/SpamProtectorManager.php index 6a635a3..303a5ae 100644 --- a/code/SpamProtectorManager.php +++ b/code/SpamProtectorManager.php @@ -48,7 +48,7 @@ class SpamProtectorManager { $protectorClass = self::get_spam_protector(); // Don't update if no protector is set - if(!$protectorClass) return; + if(!$protectorClass) return false; if(!class_exists($protectorClass)) { 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 */ 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); } } \ No newline at end of file