Revert "HTTPRequest: Replace getInfo() with new parameter 'content_length'"

This reverts commit f3cd973c
This commit is contained in:
Philipp 2020-10-11 23:25:47 +02:00
parent 0449077126
commit 2e8ad098b9
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
7 changed files with 30 additions and 14 deletions

View file

@ -160,11 +160,16 @@ class ParseUrl
return $siteinfo;
}
$curlResult = DI::httpRequest()->get($url, false, ['content_length' => 1000000]);
$curlResult = DI::httpRequest()->get($url);
if (!$curlResult->isSuccess()) {
return $siteinfo;
}
// If the file is too large then exit
if (($curlResult->getInfo()['download_content_length'] ?? 0) > 1000000) {
return $siteinfo;
}
// If it isn't a HTML file then exit
if (($curlResult->getContentType() != '') && !strstr(strtolower($curlResult->getContentType()), 'html')) {
return $siteinfo;