// SSL certificate handling
if ( ! $r['sslverify'] ) {
$options['verify'] = false;
+ $options['verifyname'] = false;
} else {
$options['verify'] = $r['sslcertificates'];
}
}
}
- // 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 );
$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.
*