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

git-svn-id: https://develop.svn.wordpress.org/trunk@2464 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-03-22 00:29:43 +00:00
parent 61efa3844d
commit 90e6959288
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.') );