[wp-cvs] wordpress/wp-includes comment-functions.php, 1.13,
1.14 functions-post.php, 1.27, 1.28
Matthew Mullenweg
saxmatt at users.sourceforge.net
Mon Jan 10 23:21:45 GMT 2005
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22286/wp-includes
Modified Files:
comment-functions.php functions-post.php
Log Message:
Whitelist trackbacks and pingbacks from domains in blogroll.
Index: comment-functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/comment-functions.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** comment-functions.php 10 Jan 2005 20:21:05 -0000 1.13
--- comment-functions.php 10 Jan 2005 23:21:42 -0000 1.14
***************
*** 714,718 ****
}
! function check_comment($author, $email, $url, $comment, $user_ip, $user_agent) {
global $wpdb;
--- 714,718 ----
}
! function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $comment_type) {
global $wpdb;
***************
*** 725,733 ****
if ( 1 == get_settings('comment_whitelist')) {
if( $author != '' && $email != '' ) {
! $ok_to_comment = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_author = '$author' AND comment_author_email = '$email' and comment_approved = '1' ");
! if ( 1 == $ok_to_comment && false === strpos( $email, get_settings('moderation_keys')) )
! return true;
! } else {
! return false;
}
}
--- 725,738 ----
if ( 1 == get_settings('comment_whitelist')) {
if( $author != '' && $email != '' ) {
! $ok_to_comment = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_author = '$author' AND comment_author_email = '$email' and comment_approved = '1' ");
! if ( 1 == $ok_to_comment && false === strpos( $email, get_settings('moderation_keys')) )
! return true;
! }
! if ( 'trackback' == $comment_type || 'pingback' == $comment_type ) { // check if domain is in blogroll
! $uri = parse_url($url);
! $domain = $uri['host'];
! $in_blogroll = $wpdb->get_var("SELECT link_id FROM $wpdb->links WHERE link_url LIKE ('%$domain%') LIMIT 1");
! if ( $in_blogroll )
! return true;
}
}
Index: functions-post.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions-post.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** functions-post.php 10 Jan 2005 20:26:10 -0000 1.27
--- functions-post.php 10 Jan 2005 23:21:42 -0000 1.28
***************
*** 453,457 ****
}
! if ( check_comment($author, $email, $url, $comment, $user_ip, $user_agent) )
$approved = 1;
else
--- 453,457 ----
}
! if ( check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $comment_type) )
$approved = 1;
else
More information about the cvs
mailing list