Validate a comment from a custom module I want to validate comments using a custom module; I am using hook_comment(), and "validate" as value for $op, but I cannot get the value of the comment field. How do I get the comment value from a custom module?
Assuming you're working in Drupal 6:

/**
 * Implementation of hook_comment().
 */
function mymodule_comment(&amp;$a1, $op) {
  switch ($op) {
    case 'validate':
      $subject = $a1['subject'];
      $comment = $a1['comment'];
      // validate here
      break;
  }
}


In Drupal 7 hook_comment() is gone, being replaced by a set of hooks hook_comment_view(), hook_comment_load(), etc. Unfortunately there is no hook_comment_validate() but see this answer for a solution.