commit e179a2543f99a90ea55f314e422e9e3db95b9f67 Author: Roman Chernikov Date: Wed Jul 29 23:05:34 2015 -0700 Add spam control after WordPres upgrade diff --git a/wp-comments-post.php b/wp-comments-post.php index 2c421d3..54a97e4 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -22,6 +22,14 @@ require( dirname(__FILE__) . '/wp-load.php' ); nocache_headers(); +$comment_spam_control = ( isset($_POST['spam-control']) ) ? trim($_POST['spam-control']) : null; + if ('7' != ($comment_spam_control) ) { + $user = wp_get_current_user(); + if ( ! $user->exists() ) { + wp_die( __( "ERROR: The comment could not be saved. You entered wrong digit. Go back and try again." ) ); + } + } + $comment = wp_handle_comment_submission( wp_unslash( $_POST ) ); if ( is_wp_error( $comment ) ) { $data = intval( $comment->get_error_data() ); diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index c914796..6471dfd 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -2199,6 +2199,8 @@ function comment_form( $args = array(), $post_id = null ) { '
' . __( 'Website' ) . ' ' . '
' . __( 'Type one digit: 2 + 3 plus two = ?' ) . '' . + '