Ticket #43691: 43691.diff
File 43691.diff, 846 bytes (added by , 4 years ago) |
---|
-
src/wp-includes/rest-api/class-wp-rest-server.php
401 401 */ 402 402 $result = apply_filters( 'rest_pre_echo_response', $result, $this, $request ); 403 403 404 // These are the request types that shouldn't have a response body. 405 $bodyless_responses = array( 204, 410, 451 ); 406 if ( in_array( $code, $bodyless_responses, true ) ) { 407 return null; 408 } 409 410 if ( $result === null ) { 411 _doing_it_wrong( __FUNCTION__, __( 'The response doesn\'t contain a body, which was expected to be there.' ), '5.3' ); 412 } 413 404 414 $result = wp_json_encode( $result ); 405 415 406 416 $json_error_message = $this->get_json_last_error();