diff options
author | Jerome Charaoui <jerome@riseup.net> | 2016-12-02 22:45:04 -0500 |
---|---|---|
committer | Jerome Charaoui <jerome@riseup.net> | 2016-12-02 22:45:04 -0500 |
commit | e858018fdd82b26bfef00e92398ce7462264c4c4 (patch) | |
tree | 6531acc3670fc4e121f90a8e6098818b01e185f3 /src/Wallabag | |
parent | 36e6ef52a176ef654eade931a23f60fd91344f2f (diff) | |
download | wallabag-e858018fdd82b26bfef00e92398ce7462264c4c4.tar.gz wallabag-e858018fdd82b26bfef00e92398ce7462264c4c4.tar.zst wallabag-e858018fdd82b26bfef00e92398ce7462264c4c4.zip |
Prevent undefined index when import fetching fails
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/ContentProxy.php | 6 |
1 files 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 | |||
76 | $entry->setContent($html); | 76 | $entry->setContent($html); |
77 | $entry->setHttpStatus(isset($content['status']) ? $content['status'] : ''); | 77 | $entry->setHttpStatus(isset($content['status']) ? $content['status'] : ''); |
78 | 78 | ||
79 | $entry->setLanguage($content['language']); | 79 | $entry->setLanguage(isset($content['language']) ? $content['language'] : ''); |
80 | $entry->setMimetype($content['content_type']); | 80 | $entry->setMimetype(isset($content['content_type']) ? $content['content_type'] : ''); |
81 | $entry->setReadingTime(Utils::getReadingTime($html)); | 81 | $entry->setReadingTime(Utils::getReadingTime($html)); |
82 | 82 | ||
83 | $domainName = parse_url($entry->getUrl(), PHP_URL_HOST); | 83 | $domainName = parse_url($entry->getUrl(), PHP_URL_HOST); |
@@ -90,7 +90,7 @@ class ContentProxy | |||
90 | } | 90 | } |
91 | 91 | ||
92 | // if content is an image define as a preview too | 92 | // if content is an image define as a preview too |
93 | if (in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { | 93 | if (isset($content['content_type']) && in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { |
94 | $entry->setPreviewPicture($content['url']); | 94 | $entry->setPreviewPicture($content['url']); |
95 | } | 95 | } |
96 | 96 | ||