From c9f097327c00a4fbd9491e1ccfe9e8d1520d8672 Mon Sep 17 00:00:00 2001 From: sergeymitr Date: Fri, 10 Jan 2025 13:46:00 -0500 Subject: [PATCH] Fix a response encoding fatal. --- projects/plugins/jetpack/class.json-api-endpoints.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/plugins/jetpack/class.json-api-endpoints.php b/projects/plugins/jetpack/class.json-api-endpoints.php index cd8210e933c1a..bd3ec25fef303 100644 --- a/projects/plugins/jetpack/class.json-api-endpoints.php +++ b/projects/plugins/jetpack/class.json-api-endpoints.php @@ -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' ) ); }