[Composer] Bump guzzlehttp/guzzle to version 7 to suppress deprecation notices

- Bump divineomega/password_exposed to version 3 to remove dependency on Guzzle version 6
- Add new ICanHandleHttpResponses->getBodyString method to solve inheritance mismatch with GuzzleHttp\Psr7\ResponseInterface->getBody return type
This commit is contained in:
Hypolite Petovan 2024-01-12 01:12:48 -05:00
parent 728130908e
commit e8c256bcff
34 changed files with 450 additions and 381 deletions

View file

@ -433,12 +433,12 @@ class HTTPSignature
return [];
}
if (!$curlResult->isSuccess() || empty($curlResult->getBody())) {
if (!$curlResult->isSuccess() || empty($curlResult->getBodyString())) {
Logger::debug('Fetching was unsuccessful', ['url' => $request, 'return-code' => $curlResult->getReturnCode(), 'error-number' => $curlResult->getErrorNumber(), 'error' => $curlResult->getError()]);
return [];
}
$content = json_decode($curlResult->getBody(), true);
$content = json_decode($curlResult->getBodyString(), true);
if (empty($content) || !is_array($content)) {
return [];
}

View file

@ -238,7 +238,7 @@ class ParseUrl
}
$curlResult = DI::httpClient()->get($url, HttpClientAccept::HTML, [HttpClientOptions::CONTENT_LENGTH => 1000000]);
if (!$curlResult->isSuccess() || empty($curlResult->getBody())) {
if (!$curlResult->isSuccess() || empty($curlResult->getBodyString())) {
Logger::info('Empty body or error when fetching', ['url' => $url, 'success' => $curlResult->isSuccess(), 'code' => $curlResult->getReturnCode()]);
return $siteinfo;
}
@ -252,7 +252,7 @@ class ParseUrl
}
}
$body = $curlResult->getBody();
$body = $curlResult->getBodyString();
if ($do_oembed) {
$oembed_data = OEmbed::fetchURL($url, false, false);