diff --git a/src/wp-includes/class-http.php b/src/wp-includes/class-http.php index d07b77ae10..45eeeaf1a1 100644 --- a/src/wp-includes/class-http.php +++ b/src/wp-includes/class-http.php @@ -359,6 +359,9 @@ class WP_Http { } } + // Avoid issues where mbstring.func_overload is enabled + mbstring_binary_safe_encoding(); + try { $requests_response = Requests::request( $url, $headers, $data, $type, $options ); @@ -373,6 +376,8 @@ class WP_Http { $response = new WP_Error( 'http_request_failed', $e->getMessage() ); } + reset_mbstring_encoding(); + /** * Fires after an HTTP API response is received and before the response is returned. *