Ticket #30259: wp-comments-post.php.patch
File wp-comments-post.php.patch, 1.3 KB (added by , 10 years ago) |
---|
-
wp-comments-post.php
119 119 $comment_type = ''; 120 120 121 121 if ( get_option('require_name_email') && !$user->exists() ) { 122 if ( 6 > strlen($comment_author_email) || '' == $comment_author ) 122 if ( 6 > strlen($comment_author_email) || '' == $comment_author ){ 123 do_action('comment_name_error'); 123 124 wp_die( __('<strong>ERROR</strong>: please fill the required fields (name, email).') ); 124 elseif ( !is_email($comment_author_email)) 125 }elseif ( !is_email($comment_author_email)){ 126 do_action('comment_email_error'); 125 127 wp_die( __('<strong>ERROR</strong>: please enter a valid email address.') ); 128 } 126 129 } 127 130 128 if ( '' == $comment_content ) 131 if ( '' == $comment_content ){ 132 do_action('comment_content_error'); 129 133 wp_die( __('<strong>ERROR</strong>: please type a comment.') ); 134 } 130 135 131 136 $comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0; 132 137 … … 134 139 135 140 $comment_id = wp_new_comment( $commentdata ); 136 141 if ( ! $comment_id ) { 142 do_action('comment_save_error'); 137 143 wp_die( __( "<strong>ERROR</strong>: The comment could not be saved. Please try again later." ) ); 138 144 } 139 145