From 59ef9b376d41b17b290e65dc74554f97156bf74c Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Sun, 16 Aug 2009 22:42:26 +0000 Subject: [PATCH] BUGFIX If spam protector class doesn't exist, a warning is thrown - however, it still tries to create the object in live mode - don't allow this --- code/SpamProtectorManager.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/code/SpamProtectorManager.php b/code/SpamProtectorManager.php index eb233af..58591e6 100644 --- a/code/SpamProtectorManager.php +++ b/code/SpamProtectorManager.php @@ -46,10 +46,8 @@ class SpamProtectorManager { user_error("Spam Protector class '$protectorClass' does not exist. Please define a valid Spam Protector", E_USER_WARNING); } - if(!is_object($protector)) { - $protector = new $protectorClass(); - } - + if(!$protectorClass) return null; + try { $check = $protector->updateForm($form, $before, $fieldsToSpamServiceMapping); } catch (Exception $e) {