Ticket #39650: 39650.5.patch
| File 39650.5.patch, 2.2 KB (added by , 9 years ago) |
|---|
-
wp-comments-post.php
28 28 if ( ! empty( $data ) ) { 29 29 wp_die( '<p>' . $comment->get_error_message() . '</p>', __( 'Comment Submission Failure' ), array( 'response' => $data, 'back_link' => true ) ); 30 30 } else { 31 exit;31 wp_die( '<p>' . $comment->get_error_message() . '</p>', __( 'Comment Submission Failure' ), array( 'back_link' => true ) ); 32 32 } 33 33 } 34 34 -
wp-includes/comment.php
2956 2956 */ 2957 2957 do_action( 'comment_id_not_found', $comment_post_ID ); 2958 2958 2959 return new WP_Error( 'comment_id_not_found' );2959 return new WP_Error( 'comment_id_not_found', __( 'Sorry, comments are not allowed for this item.' ), 403 ); 2960 2960 2961 2961 } 2962 2962 … … 2964 2964 $status = get_post_status( $post ); 2965 2965 2966 2966 if ( ( 'private' == $status ) && ! current_user_can( 'read_post', $comment_post_ID ) ) { 2967 return new WP_Error( 'comment_id_not_found' );2967 return new WP_Error( 'comment_id_not_found', __( 'Sorry, comments are not allowed for this item.' ), 403 ); 2968 2968 } 2969 2969 2970 2970 $status_obj = get_post_status_object( $status ); … … 2993 2993 */ 2994 2994 do_action( 'comment_on_trash', $comment_post_ID ); 2995 2995 2996 return new WP_Error( 'comment_on_trash' );2996 return new WP_Error( 'comment_on_trash', __( 'Sorry, comments are not allowed for this item.' ), 403 ); 2997 2997 2998 2998 } elseif ( ! $status_obj->public && ! $status_obj->private ) { 2999 2999 … … 3006 3006 */ 3007 3007 do_action( 'comment_on_draft', $comment_post_ID ); 3008 3008 3009 return new WP_Error( 'comment_on_draft' );3009 return new WP_Error( 'comment_on_draft', __( 'Sorry, comments are not allowed for this item.' ), 403 ); 3010 3010 3011 3011 } elseif ( post_password_required( $comment_post_ID ) ) { 3012 3012 … … 3019 3019 */ 3020 3020 do_action( 'comment_on_password_protected', $comment_post_ID ); 3021 3021 3022 return new WP_Error( 'comment_on_password_protected' );3022 return new WP_Error( 'comment_on_password_protected', __( 'Sorry, comments are not allowed for this item.' ), 403 ); 3023 3023 3024 3024 } else { 3025 3025