Validate comment author email. http://mosquito.wordpress.org/view.php?id=982 Props: MtDewVirus

git-svn-id: http://svn.automattic.com/wordpress/trunk@2464 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-03-22 00:29:43 +00:00
parent 0d88aac206
commit 6ecc63bbc7
1 changed files with 6 additions and 2 deletions

View File

@ -31,8 +31,12 @@ endif;
$comment_type = '';
if ( (get_settings('require_name_email') && !$user_ID) && ('' == $comment_author_email || '' == $comment_author) )
die( __('Error: please fill the required fields (name, email).') );
if ( get_settings('require_name_email') && !$user_ID ) {
if ('' == $comment_author_email || '' == $comment_author)
die( __('Error: please fill the required fields (name, email).') );
elseif ( !is_email($comment_author_email))
die( __('Error: please enter a valid email address.') );
}
if ( '' == $comment_content )
die( __('Error: please type a comment.') );