[wp-cvs] wordpress/wp-includes functions.php,1.177,1.178

Matthew Mullenweg saxmatt at users.sourceforge.net
Mon Oct 4 08:49:47 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2486/wp-includes

Modified Files:
	functions.php 
Log Message:
Kitten's emergent registration / comment whitelisting patch.

Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.177
retrieving revision 1.178
diff -C2 -d -r1.177 -r1.178
*** functions.php	4 Oct 2004 08:03:50 -0000	1.177
--- functions.php	4 Oct 2004 08:49:45 -0000	1.178
***************
*** 1474,1477 ****
--- 1474,1479 ----
  
  function check_comment($author, $email, $url, $comment, $user_ip) {
+ 	global $wpdb;
+ 
  	if (1 == get_settings('comment_moderation')) return false; // If moderation is set to manual
  
***************
*** 1479,1484 ****
  		return false; // Check # of external links
  
! 	if ('' == trim( get_settings('moderation_keys') ) ) return true; // If moderation keys are empty
! 	$words = explode("\n", get_settings('moderation_keys') );
  	foreach ($words as $word) {
  		$word = trim($word);
--- 1481,1497 ----
  		return false; // Check # of external links
  
! 	// Comment whitelisting:
! 	if ( 1 == get_settings('comment_whitelist')) {
! 		$ok_to_comment = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_author_email = '$email' and comment_approved = '1' ");
! 		if ( 1 == $ok_to_comment && false === strpos( $email, get_settings('moderation_keys')) )
! 			return true
! 	return false;
! 	}
! 
! 	$mod_keys = trim( get_settings('moderation_keys') );
! 	if ('' == $mod_keys )
! 		return true; // If moderation keys are empty
! 	$words = explode("\n", $mod_keys );
! 
  	foreach ($words as $word) {
  		$word = trim($word);




More information about the cvs mailing list