Ticket #38803: 38803.2.patch
| File 38803.2.patch, 2.0 KB (added by , 9 years ago) |
|---|
-
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
109 109 $post = get_post( $post_id ); 110 110 111 111 if ( ! empty( $post_id ) && $post && ! $this->check_read_post_permission( $post ) ) { 112 return new WP_Error( 'rest_cannot_read_post', __( 'Sorry, you cannotread the post for this comment.' ), array( 'status' => rest_authorization_required_code() ) );112 return new WP_Error( 'rest_cannot_read_post', __( 'Sorry, you are not allowed to read the post for this comment.' ), array( 'status' => rest_authorization_required_code() ) ); 113 113 } elseif ( 0 === $post_id && ! current_user_can( 'moderate_comments' ) ) { 114 114 return new WP_Error( 'rest_cannot_read', __( 'Sorry, you are not allowed to read comments without a post.' ), array( 'status' => rest_authorization_required_code() ) ); 115 115 } … … 399 399 } 400 400 401 401 if ( ! $this->check_read_post_permission( $post ) ) { 402 return new WP_Error( 'rest_cannot_read_post', __( 'Sorry, you cannotread the post for this comment.' ), array( 'status' => rest_authorization_required_code() ) );402 return new WP_Error( 'rest_cannot_read_post', __( 'Sorry, you are not allowed to read the post for this comment.' ), array( 'status' => rest_authorization_required_code() ) ); 403 403 } 404 404 405 405 if ( ! comments_open( $post->ID ) ) { … … 615 615 } 616 616 617 617 if ( isset( $request['type'] ) && get_comment_type( $id ) !== $request['type'] ) { 618 return new WP_Error( 'rest_comment_invalid_type', __( 'Sorry, you cannotchange the comment type.' ), array( 'status' => 404 ) );618 return new WP_Error( 'rest_comment_invalid_type', __( 'Sorry, you are not allowed to change the comment type.' ), array( 'status' => 404 ) ); 619 619 } 620 620 621 621 $prepared_args = $this->prepare_item_for_database( $request );