From 5ac128830b74380f4de4a5ac3fab72d19504240f Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 26 Nov 2009 20:16:37 +0000 Subject: [PATCH] BUGFIX Don't try to instanciate new SpamProtector instances if none is set in SpamProtectorManager::update_form() --- code/SpamProtectorManager.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/SpamProtectorManager.php b/code/SpamProtectorManager.php index 22cf019..6a635a3 100644 --- a/code/SpamProtectorManager.php +++ b/code/SpamProtectorManager.php @@ -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); }