X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FPost%2FLink.php;h=fb7d0edb8ddb88dccad5380e7f56dbc3853a32fc;hb=a662245c744f4d2faa1b533977f7d21b4de6a724;hp=edd3411624802a7495f92c218f8f2f297e2b4138;hpb=65ca164487af3890affe224e14b090cc654a2bd0;p=friendica.git diff --git a/src/Model/Post/Link.php b/src/Model/Post/Link.php index edd3411624..fb7d0edb8d 100644 --- a/src/Model/Post/Link.php +++ b/src/Model/Post/Link.php @@ -1,6 +1,6 @@ $uri_id, 'url' => $url]); + } + public static function getByLink(int $uri_id, string $url, $size = '') { if (empty($uri_id) || empty($url) || Proxy::isLocalImage($url)) { @@ -83,11 +97,11 @@ class Link return $url . $id; } - private static function fetchMimeType(string $url) + private static function fetchMimeType(string $url, string $accept = HttpClientAccept::DEFAULT) { $timeout = DI::config()->get('system', 'xrd_timeout'); - $curlResult = DI::httpRequest()->head($url, ['timeout' => $timeout]); + $curlResult = DI::httpClient()->head($url, [HttpClientOptions::TIMEOUT => $timeout, HttpClientOptions::ACCEPT_CONTENT => $accept]); if ($curlResult->isSuccess()) { if (empty($media['mimetype'])) { return $curlResult->getHeader('Content-Type')[0] ?? '';