Skip to content

Commit

Permalink
Fix a response encoding fatal.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeymitr committed Jan 10, 2025
1 parent 5ae64b8 commit c9f0973
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions projects/plugins/jetpack/class.json-api-endpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -2737,6 +2737,8 @@ public function rest_callback( WP_REST_Request $request ) {
$response = WPCOM_JSON_API::serializable_error( $response );
}

$response = wp_json_encode( $response );

if ( $request->get_param( 'http_envelope' ) ) {
$response = wp_json_encode( WPCOM_JSON_API::wrap_http_envelope( $status_code, $response, 'application/json' ) );
}
Expand Down

0 comments on commit c9f0973

Please sign in to comment.