HTTPRequest: Replace getInfo() with new parameter 'content_length'
[friendica.git/.git] / src / Util / ParseUrl.php
index c3cbda7..1a81a25 100644 (file)
@@ -160,16 +160,11 @@ class ParseUrl
                        return $siteinfo;
                }
 
-               $curlResult = DI::httpRequest()->get($url);
+               $curlResult = DI::httpRequest()->get($url, false, ['content_length' => 1000000]);
                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;