diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-01-16 03:50:51 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-01-16 03:50:51 +0000 |
commit | 23b0ee3628ff4001da1d4635f403622acb6baf83 (patch) | |
tree | dd30298190254a3b427bb72a8a64e2795a9c70b2 /modules | |
parent | ec272821bbce1f32957e2aa808e4c25d9d177d16 (diff) |
Don't try to check comments if Akismet lacks an API key
Diffstat (limited to 'modules')
-rw-r--r-- | modules/akismet/helpers/akismet_event.php | 8 |
1 files changed, 8 insertions, 0 deletions
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") { |