From e858018fdd82b26bfef00e92398ce7462264c4c4 Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Fri, 2 Dec 2016 22:45:04 -0500 Subject: [PATCH] Prevent undefined index when import fetching fails --- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 642ba6f9..2690edbe 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -76,8 +76,8 @@ class ContentProxy $entry->setContent($html); $entry->setHttpStatus(isset($content['status']) ? $content['status'] : ''); - $entry->setLanguage($content['language']); - $entry->setMimetype($content['content_type']); + $entry->setLanguage(isset($content['language']) ? $content['language'] : ''); + $entry->setMimetype(isset($content['content_type']) ? $content['content_type'] : ''); $entry->setReadingTime(Utils::getReadingTime($html)); $domainName = parse_url($entry->getUrl(), PHP_URL_HOST); @@ -90,7 +90,7 @@ class ContentProxy } // if content is an image define as a preview too - if (in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { + if (isset($content['content_type']) && in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { $entry->setPreviewPicture($content['url']); } -- 2.41.0