Merge remote-tracking branch 'upstream/develop' into ocr

This commit is contained in:
Michael 2024-01-14 18:33:02 +00:00
commit 5acfff1152
60 changed files with 526 additions and 488 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);