diff --git a/core/modules/update/update.fetch.inc b/core/modules/update/update.fetch.inc index 0ce01b1..ce178e0 100644 --- a/core/modules/update/update.fetch.inc +++ b/core/modules/update/update.fetch.inc @@ -5,6 +5,8 @@ * Code required only when fetching information about available updates. */ +use Guzzle\Http\Exception\RequestException; + /** * Page callback: Checks for updates and displays the update status report. * @@ -149,12 +151,13 @@ function _update_process_fetch_task($project) { $project_name = $project['name']; if (empty($fail[$fetch_url_base]) || $fail[$fetch_url_base] < $max_fetch_attempts) { - $result = drupal_http_request($url, array('headers' => array('accept' => 'text/xml'))); - if (isset($result->error)) { - watchdog('update', 'HTTP request to @url failed with error: @error.', array('@url' => $url, '@error' => $result->error)); - } - elseif (!isset($result->error) && isset($result->data)) { - $data = $result->data; + try { + $data = Drupal::httpClient() + ->get($url, array('Accept' => 'text/xml')) + ->send() + ->getBody(TRUE); + } catch (RequestException $exception) { + watchdog_exception('update', $exception); } }