From 903c646a622f22890e4b33ebf55cae91f1bb49be Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 5 Jul 2021 19:42:17 +0000 Subject: [PATCH] Style --- src/Model/Post/Link.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Model/Post/Link.php b/src/Model/Post/Link.php index 83df038da..c1cc3ae1e 100644 --- a/src/Model/Post/Link.php +++ b/src/Model/Post/Link.php @@ -45,7 +45,7 @@ class Link Logger::info('Found', ['id' => $id, 'url' => $url]); } else { $mime = self::fetchMimeType($url); - + DBA::insert('post-link', ['uri-id' => $uri_id, 'url' => $url, 'mimetype' => $mime]); $id = DBA::lastInsertId(); Logger::info('Inserted', ['id' => $id, 'url' => $url]); @@ -79,6 +79,7 @@ class Link private static function fetchMimeType(string $url) { $timeout = DI::config()->get('system', 'xrd_timeout'); + $curlResult = DI::httpRequest()->head($url, ['timeout' => $timeout]); if ($curlResult->isSuccess()) { if (empty($media['mimetype'])) {