diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index d2c1312..f3e2c07 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1330,8 +1330,8 @@ function install_retrieve_file($uri, $destination) { } try { - $request = \Drupal::httpClient()->get($uri, array('headers' => array('Accept' => 'text/plain'))); - $data = $request->getBody(TRUE); + $response = \Drupal::httpClient()->get($uri, array('headers' => array('Accept' => 'text/plain'))); + $data = (string) $response->getBody(); if (empty($data)) { return FALSE; } diff --git a/core/modules/aggregator/src/Form/OpmlFeedAdd.php b/core/modules/aggregator/src/Form/OpmlFeedAdd.php index 2eec507..bcb5706 100644 --- a/core/modules/aggregator/src/Form/OpmlFeedAdd.php +++ b/core/modules/aggregator/src/Form/OpmlFeedAdd.php @@ -122,7 +122,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { // @todo Move this to a fetcher implementation. try { $response = $this->httpClient->get($form_state->getValue('remote')); - $data = $response->getBody(TRUE); + $data = (string) $response->getBody(); } catch (RequestException $e) { $this->logger('aggregator')->warning('Failed to download OPML file due to "%error".', array('%error' => $e->getMessage())); diff --git a/core/modules/hal/src/Normalizer/FileEntityNormalizer.php b/core/modules/hal/src/Normalizer/FileEntityNormalizer.php index f993024..52ee04b 100644 --- a/core/modules/hal/src/Normalizer/FileEntityNormalizer.php +++ b/core/modules/hal/src/Normalizer/FileEntityNormalizer.php @@ -64,7 +64,7 @@ public function normalize($entity, $format = NULL, array $context = array()) { * {@inheritdoc} */ public function denormalize($data, $class, $format = NULL, array $context = array()) { - $file_data = $this->httpClient->get($data['uri'][0]['value'])->getBody(TRUE); + $file_data = (string) $this->httpClient->get($data['uri'][0]['value'])->getBody(); $path = 'temporary://' . drupal_basename($data['uri'][0]['value']); $data['uri'] = file_unmanaged_save_data($file_data, $path); diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 8f2a8ab..54da72c 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1283,9 +1283,9 @@ function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $repl } } try { - $data = \Drupal::httpClient() + $data = (string) \Drupal::httpClient() ->get($url) - ->getBody(TRUE); + ->getBody(); $local = $managed ? file_save_data($data, $path, $replace) : file_unmanaged_save_data($data, $path, $replace); } catch (RequestException $exception) {