From 6ecc63bbc7ca4523b0ca8d3357198ea18920db99 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 22 Mar 2005 00:29:43 +0000 Subject: [PATCH] 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 --- wp-comments-post.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-comments-post.php b/wp-comments-post.php index 6833c2c57..63753286d 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -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.') );