Index: comment.php
===================================================================
--- comment.php	(revision 6597)
+++ comment.php	(working copy)
@@ -8,19 +8,33 @@
 /**
  * check_comment() - Checks whether a comment passes internal checks to be allowed to add
  *
- * {@internal Missing Long Description}}
+ * If comment moderation is set in the administration, then all comments, regardless
+ * of their type and whitelist will be set to false.
  *
+ * If the number of links exceeds the amount in the administration, then the check
+ * fails.
+ *
+ * If any of the parameter contents match the blacklist of words, then the check
+ * fails.
+ *
+ * If the comment is a trackback and part of the blogroll, then the trackback is
+ * automatically whitelisted. If the comment author was approved before, then the
+ * comment is automatically whitelisted.
+ *
+ * If none of the checks fail, then the failback is to set the check to pass (return
+ * true).
+ *
  * @since 1.2
  * @uses $wpdb
  *
- * @param string $author {@internal Missing Description }}
- * @param string $email {@internal Missing Description }}
- * @param string $url {@internal Missing Description }}
- * @param string $comment {@internal Missing Description }}
- * @param string $user_ip {@internal Missing Description }}
- * @param string $user_agent {@internal Missing Description }}
- * @param string $comment_type {@internal Missing Description }}
- * @return bool {@internal Missing Description }}
+ * @param string $author Comment Author's name
+ * @param string $email Comment Author's email
+ * @param string $url Comment Author's URL
+ * @param string $comment Comment contents
+ * @param string $user_ip Comment Author's IP address
+ * @param string $user_agent Comment Author's User Agent
+ * @param string $comment_type Comment type, either user submitted comment, trackback, or pingback
+ * @return bool Whether the checks passed (true) and the comments should be displayed or set to moderated
  */
 function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $comment_type) {
 	global $wpdb;
@@ -170,17 +184,17 @@
 			$query .= " AND comment_approved = '1'";
 		$myrow = $wpdb->get_row($query, ARRAY_A);
 	} else {
-		$myrow['comment_ID']           = $postc->comment_ID;
-		$myrow['comment_post_ID']      = $postc->comment_post_ID;
-		$myrow['comment_author']       = $postc->comment_author;
-		$myrow['comment_author_email'] = $postc->comment_author_email;
-		$myrow['comment_author_url']   = $postc->comment_author_url;
-		$myrow['comment_author_IP']    = $postc->comment_author_IP;
-		$myrow['comment_date']         = $postc->comment_date;
-		$myrow['comment_content']      = $postc->comment_content;
-		$myrow['comment_karma']        = $postc->comment_karma;
-		$myrow['comment_approved']     = $postc->comment_approved;
-		$myrow['comment_type']         = $postc->comment_type;
+		$myrow['comment_ID']			= $postc->comment_ID;
+		$myrow['comment_post_ID']		= $postc->comment_post_ID;
+		$myrow['comment_author']		= $postc->comment_author;
+		$myrow['comment_author_email']	= $postc->comment_author_email;
+		$myrow['comment_author_url']	= $postc->comment_author_url;
+		$myrow['comment_author_IP']		= $postc->comment_author_IP;
+		$myrow['comment_date']			= $postc->comment_date;
+		$myrow['comment_content']		= $postc->comment_content;
+		$myrow['comment_karma']			= $postc->comment_karma;
+		$myrow['comment_approved']		= $postc->comment_approved;
+		$myrow['comment_type']			= $postc->comment_type;
 	}
 	return $myrow;
 }
@@ -228,8 +242,7 @@
  * @since 2.0.0
  * @uses $wpdb
  *
- * @param int $post_id Optional. Comment amount in post if > 0, else total com
-ments blog wide
+ * @param int $post_id Optional. Comment amount in post if > 0, else total comments blog wide
  * @return array The amount of spam, approved, awaiting moderation, and total
  */
 function get_comment_count( $post_id = 0 ) {
@@ -249,23 +262,23 @@
 		GROUP BY comment_approved 
 	", ARRAY_A);
 
-	$comment_count = array(                         
-		"approved"              => 0,                
-		"awaiting_moderation"   => 0,
-		"spam"                  => 0,
-		"total_comments"        => 0
+	$comment_count = array(
+		"approved"				=> 0,
+		"awaiting_moderation"	=> 0,
+		"spam"					=> 0,
+		"total_comments"		=> 0
 	); 
 
-	foreach ( $totals as $row ) { 
-		switch ( $row['comment_approved'] ) { 
-			case 'spam': 
-				$comment_count['spam'] = $row['total']; 
+	foreach ( $totals as $row ) {
+		switch ( $row['comment_approved'] ) {
+			case 'spam':
+				$comment_count['spam'] = $row['total'];
 				$comment_count["total_comments"] += $row['total'];
-				break; 
-			case 1: 
-				$comment_count['approved'] = $row['total']; 
+				break;
+			case 1:
+				$comment_count['approved'] = $row['total'];
 				$comment_count['total_comments'] += $row['total'];
-				break; 
+				break;
 			case 0:
 				$comment_count['awaiting_moderation'] = $row['total'];
 				$comment_count['total_comments'] += $row['total'];
@@ -786,14 +799,14 @@
  */
 function wp_defer_comment_counting($defer=null) {
 	static $_defer = false;
-	
+
 	if ( is_bool($defer) ) {
 		$_defer = $defer;
 		// flush any deferred counts
 		if ( !$defer )
 			wp_update_comment_count( null, true );
 	}
-	
+
 	return $_defer;
 }
 
@@ -817,7 +830,7 @@
  */
 function wp_update_comment_count($post_id, $do_deferred=false) {
 	static $_deferred = array();
-	
+
 	if ( $do_deferred ) {
 		$_deferred = array_unique($_deferred);
 		foreach ( $_deferred as $i => $_post_id ) {
@@ -825,7 +838,7 @@
 			unset( $_deferred[$i] ); /** @todo Move this outside of the foreach and reset $_deferred to an array instead */
 		}
 	}
-	
+
 	if ( wp_defer_comment_counting() ) {
 		$_deferred[] = $post_id;
 		return true;
@@ -833,7 +846,7 @@
 	elseif ( $post_id ) {
 		return wp_update_comment_count_now($post_id);
 	}
-		
+
 }
 
 /**
@@ -1028,7 +1041,7 @@
 	$excerpt = str_replace(']]>', ']]&gt;', $excerpt);
 	$excerpt = strip_tags($excerpt);
 	if ( function_exists('mb_strcut') ) // For international trackbacks
-    	$excerpt = mb_strcut($excerpt, 0, 252, get_option('blog_charset')) . '...';
+		$excerpt = mb_strcut($excerpt, 0, 252, get_option('blog_charset')) . '...';
 	else
 		$excerpt = substr($excerpt, 0, 252) . '...';
 

