昨天回复网友评论的时候没有登陆管理员账号,直接输入了自己的邮箱,结果评论竟然直接发上去了。
如果有人冒充管理员来回复网友的留言,是一个不小的安全隐患。

在此列出一下解决办法:

1.打开根目录的wp-comments-post.php
2.在if ( ” == $comment_content )前边加入如下代码

if (!$user->ID) {
$result_set = $wpdb->get_results(“SELECT display_name, user_email FROM $wpdb->users WHERE display_name = ‘” . $comment_author . “‘ OR user_email = ‘” . $comment_author_email . “‘”);
if ($result_set) {
if ($result_set[0]->display_name == $commentauthor) {
wp_die( _
(‘您所填写的昵称已经有人使用了…’) );
} else {
wp_die( __(‘您所填写的邮箱已经有人使用了…’) );
}
}
}

3.替换上传