summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-01-06 14:36:20 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-01-06 14:36:20 +0000
commit4645c459e14c5dbd2330ea176396784049a1cdc8 (patch)
tree66090dd48dfff00d1dbf0d76c57d85b9bfac50cf
parentcb3109784e073cc02216e189eb9f17818c078f30 (diff)
Add a catch around the call to the spam filter and if the spam filter check fails set the comment
state to unpublished.
-rw-r--r--modules/comment/helpers/comment.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php
index c0864fee..4bc77e57 100644
--- a/modules/comment/helpers/comment.php
+++ b/modules/comment/helpers/comment.php
@@ -52,7 +52,12 @@ class comment_Core {
// @todo Figure out how to mock up the test of the spam_filter
if (module::is_installed("spam_filter") && TEST_MODE == 0) {
- SpamFilter::instance()->check_comment($comment);
+ try {
+ SpamFilter::instance()->check_comment($comment);
+ } catch (Exception $e) {
+ Kohana::log("error", print_r($e, 1));
+ $comment->state = "unpublished";
+ }
} else {
$comment->state = "published";
}