WordPress 4.6.2
[autoinstalls/wordpress.git] / wp-includes / class-http.php
index c0272ba487fbc89d42cc9cfff28e4890e9317db7..5a3075846c4a76acefd3f57c5613d04b3c007599 100644 (file)
@@ -332,6 +332,7 @@ class WP_Http {
                // SSL certificate handling
                if ( ! $r['sslverify'] ) {
                        $options['verify'] = false;
+                       $options['verifyname'] = false;
                } else {
                        $options['verify'] = $r['sslcertificates'];
                }
@@ -362,8 +363,8 @@ class WP_Http {
                        }
                }
 
-               // Work around a bug in Requests when the path starts with // See https://github.com/rmccue/Requests/issues/231
-               $url = preg_replace( '!^(\w+://[^/]+)//(.*)$!i', '$1/$2', $url );
+               // Avoid issues where mbstring.func_overload is enabled
+               mbstring_binary_safe_encoding();
 
                try {
                        $requests_response = Requests::request( $url, $headers, $data, $type, $options );
@@ -379,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.
                 *