File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
src/wp-includes/rest-api/endpoints
tests/phpunit/tests/rest-api Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1890,7 +1890,7 @@ protected function check_read_post_permission( $post, $request ) {
18901890 * @return bool Whether the comment can be read.
18911891 */
18921892 protected function check_read_permission ( $ comment , $ request ) {
1893- if ( 'comment ' = == $ comment ->comment_type && ! empty ( $ comment ->comment_post_ID ) ) {
1893+ if ( 'note ' ! == $ comment ->comment_type && ! empty ( $ comment ->comment_post_ID ) ) {
18941894 $ post = get_post ( $ comment ->comment_post_ID );
18951895 if ( $ post ) {
18961896 if ( $ this ->check_read_post_permission ( $ post , $ request ) && 1 === (int ) $ comment ->comment_approved ) {
Original file line number Diff line number Diff line change @@ -4226,16 +4226,16 @@ public function test_get_items_type_arg_unauthenticated( $comment_type, $count )
42264226 $ request ->set_param ( 'per_page ' , self ::$ per_page );
42274227
42284228 $ response = rest_get_server ()->dispatch ( $ request );
4229- $ this ->assertEquals ( 'comment ' = == $ comment_type ? 200 : 401 , $ response ->get_status () );
4230- if ( 'comment ' ! == $ comment_type ) {
4229+ $ this ->assertEquals ( 'note ' ! == $ comment_type ? 200 : 401 , $ response ->get_status () );
4230+ if ( 'note ' = == $ comment_type ) {
42314231 $ this ->assertErrorResponse ( 'rest_forbidden_param ' , $ response , 401 );
42324232 }
42334233
42344234 // Next, test getting the individual comments.
42354235 foreach ( $ comments as $ comment ) {
42364236 $ request = new WP_REST_Request ( 'GET ' , sprintf ( '/wp/v2/comments/%d ' , $ comment ) );
42374237 $ response = rest_get_server ()->dispatch ( $ request );
4238- $ this ->assertEquals ( 'comment ' = == $ comment_type ? 200 : 401 , $ response ->get_status () );
4238+ $ this ->assertEquals ( 'note ' ! == $ comment_type ? 200 : 401 , $ response ->get_status () );
42394239 }
42404240 }
42414241
You can’t perform that action at this time.
0 commit comments