Index: wordfilter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wordfilter/wordfilter.module,v
retrieving revision 1.7.2.4
diff -u -p -r1.7.2.4 wordfilter.module
--- wordfilter.module	12 Apr 2008 09:24:40 -0000	1.7.2.4
+++ wordfilter.module	20 Apr 2008 12:10:27 -0000
@@ -102,6 +102,13 @@ function wordfilter_settings_form() {
     "#return_value" => true
   );
 
+  $form["wordfilter_comment_title"] = array(
+    "#type" => "checkbox",
+    "#title" => t("Enable Word Filtering On Comment Titles"),
+    "#default_value" => variable_get("wordfilter_comment_title", true),
+    "#return_value" => true
+  );
+
   return system_settings_form($form);
 }
 
@@ -122,8 +129,45 @@ function wordfilter_settings_form() {
  *
  */
 function wordfilter_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
-  if ($node && ($op == 'submit' || $op == 'update') && variable_get("wordfilter_node_title", true)) {
-    $node->title = wordfilter_filter_process($node->title);
+  switch ($op) {
+    case 'insert':
+    case 'update':
+      if (variable_get('wordfilter_node_title', TRUE)) {
+        $node->title = wordfilter_filter_process($node->title);
+      }
+      break;
+    case 'load':
+      if (variable_get('wordfilter_node_title', TRUE)) {
+        $node->title = wordfilter_filter_process($node->title);
+      }
+      break;
+  }
+}
+
+ /**
+ * Implementation of hook_comment().
+ *
+ * @param &$comment
+ *   editable comment array/object or comment form
+ *
+ * @param $op
+ *   string for operation type
+ */
+function wordfilter_comment(&$comment, $op) {
+  switch ($op) {
+    case 'insert':
+    case 'update':
+    case 'publish':
+      if (variable_get('wordfilter_comment_title', TRUE)) {
+        $comment = (array)$comment;
+        $comment['subject'] = wordfilter_filter_process($comment['subject']);
+      }
+      break;
+    case 'view':
+      if (variable_get('wordfilter_comment_title', TRUE)) {
+        $comment->subject = wordfilter_filter_process($comment->subject);
+      }
+      break;
   }
 }
 
