mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Make sure email and name are not blank when checking comment author in whitelist.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b3547b3d8c
commit
3ec05be4d2
@ -1647,10 +1647,13 @@ function check_comment($author, $email, $url, $comment, $user_ip) {
|
||||
|
||||
// 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')) )
|
||||
if( $author != '' && $email != '' ) {
|
||||
$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;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$mod_keys = trim( get_settings('moderation_keys') );
|
||||
|
Loading…
x
Reference in New Issue
Block a user