HTTP: Call `mbstring_binary_safe_encoding()` before making a request with Requests to avoid issues with `mbstring.func_overload`.

Props SergeyBiryukov.
Merges [38894] to the 4.6 branch.
Fixes #38226.

Built from https://develop.svn.wordpress.org/branches/4.6@38895


git-svn-id: http://core.svn.wordpress.org/branches/4.6@38838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2016-10-25 00:47:30 +00:00
parent 4d089ce55b
commit f5f0032925
2 changed files with 6 additions and 1 deletions

View File

@ -363,6 +363,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 );
@ -377,6 +380,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.
*

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6.2-alpha-38728';
$wp_version = '4.6.2-alpha-38895';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.