? sites/d7-head.com
? sites/favicon.ico
? sites/logo.png
? sites/all/.DS_Store
? sites/all/libraries
Index: modules/comment/comment.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.api.php,v
retrieving revision 1.18
diff -u -p -r1.18 comment.api.php
--- modules/comment/comment.api.php	23 Oct 2010 15:30:34 -0000	1.18
+++ modules/comment/comment.api.php	23 Nov 2010 03:32:51 -0000
@@ -12,6 +12,21 @@
  */
 
 /**
+ * The user has just finished editing the comment and is trying to preview or
+ * submit it. This hook can be used to check or even modify the comment. Errors
+ * should be set with form_set_error().
+ * 
+ * @param $form
+ *   The comment form.
+ * @param $form_state
+ *   The form state array.
+ */
+function hook_comment_validate($form, &$form_state) {
+  // validate the comment body
+  validate_comment($form_state['values']['comment_body']['und'][0]['value']);
+}
+
+/**
  * The comment passed validation and is about to be saved.
  *
  * Modules may make changes to the comment before it is saved to the database.
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.917
diff -u -p -r1.917 comment.module
--- modules/comment/comment.module	15 Nov 2010 00:49:46 -0000	1.917
+++ modules/comment/comment.module	23 Nov 2010 03:32:52 -0000
@@ -2112,6 +2112,12 @@ function comment_form_validate($form, &$
   if ($form_state['values']['homepage'] && !valid_url($form_state['values']['homepage'], TRUE)) {
     form_set_error('homepage', t('The URL of your homepage is not valid. Remember that it must be fully qualified, i.e. of the form <code>http://example.com/directory</code>.'));
   }
+  
+  // invoke hook_comment_validate
+  foreach (module_implements('comment_validate') as $name) {
+  	$function = $name . '_comment_validate';
+    $function($form, $form_state);
+  }
 }
 
 /**
