From 23b0ee3628ff4001da1d4635f403622acb6baf83 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 16 Jan 2009 03:50:51 +0000 Subject: Don't try to check comments if Akismet lacks an API key --- modules/akismet/helpers/akismet_event.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules/akismet') diff --git a/modules/akismet/helpers/akismet_event.php b/modules/akismet/helpers/akismet_event.php index 1a14699b..41388dfb 100644 --- a/modules/akismet/helpers/akismet_event.php +++ b/modules/akismet/helpers/akismet_event.php @@ -19,6 +19,10 @@ */ class akismet_event_Core { static function comment_created($comment) { + if (!module::get_var("akismet", "api_key")) { + return; + } + switch(akismet::check_comment($comment)) { case "spam": $comment->state = "spam"; @@ -37,6 +41,10 @@ class akismet_event_Core { } static function comment_updated($old, $new) { + if (!module::get_var("akismet", "api_key")) { + return; + } + if ($old->state != "spam" && $new->state == "spam") { akismet::submit_spam($new); } else if ($old->state == "spam" && $new->state != "spam") { -- cgit v1.2.3