HTTPRequest: Replace getInfo() with new parameter 'content_length'
[friendica.git/.git] / src / Network / Probe.php
index 3fe0352..cfd0368 100644 (file)
@@ -423,16 +423,11 @@ class Probe
         */
        private static function getHideStatus($url)
        {
-               $curlResult = DI::httpRequest()->get($url);
+               $curlResult = DI::httpRequest()->get($url, false, ['content_length' => 1000000]);
                if (!$curlResult->isSuccess()) {
                        return false;
                }
 
-               // If the file is too large then exit
-               if (($curlResult->getInfo()['download_content_length'] ?? 0) > 1000000) {
-                       return false;
-               }
-
                // If it isn't a HTML file then exit
                if (($curlResult->getContentType() != '') && !strstr(strtolower($curlResult->getContentType()), 'html')) {
                        return false;