diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Helper')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/ContentProxy.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 59465ad1..c6fa0d98 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php | |||
@@ -299,8 +299,6 @@ class ContentProxy | |||
299 | // if content is an image, define it as a preview too | 299 | // if content is an image, define it as a preview too |
300 | if (!empty($content['headers']['content-type']) && \in_array($this->mimeGuesser->guess($content['headers']['content-type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { | 300 | if (!empty($content['headers']['content-type']) && \in_array($this->mimeGuesser->guess($content['headers']['content-type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { |
301 | $previewPictureUrl = $content['url']; | 301 | $previewPictureUrl = $content['url']; |
302 | |||
303 | $entry->setMimetype($content['headers']['content-type']); | ||
304 | } elseif (empty($previewPictureUrl)) { | 302 | } elseif (empty($previewPictureUrl)) { |
305 | $this->logger->debug('Extracting images from content to provide a default preview picture'); | 303 | $this->logger->debug('Extracting images from content to provide a default preview picture'); |
306 | $imagesUrls = DownloadImages::extractImagesUrlsFromHtml($content['html']); | 304 | $imagesUrls = DownloadImages::extractImagesUrlsFromHtml($content['html']); |
@@ -311,6 +309,10 @@ class ContentProxy | |||
311 | } | 309 | } |
312 | } | 310 | } |
313 | 311 | ||
312 | if (!empty($content['headers']['content-type'])) { | ||
313 | $entry->setMimetype($content['headers']['content-type']); | ||
314 | } | ||
315 | |||
314 | if (!empty($previewPictureUrl)) { | 316 | if (!empty($previewPictureUrl)) { |
315 | $this->updatePreviewPicture($entry, $previewPictureUrl); | 317 | $this->updatePreviewPicture($entry, $previewPictureUrl); |
316 | } | 318 | } |