diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-03-18 06:23:41 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-03-18 06:23:41 +0100 |
commit | 8ca858ee7301ea332baa9ad9543bb72d10b5caa2 (patch) | |
tree | 7be543c94b58a07a423a3d48076cc4ec91a9647c /src | |
parent | a48ff25d4c9f99dfb8ec1a9a1ae296417af6d9c9 (diff) | |
download | wallabag-8ca858ee7301ea332baa9ad9543bb72d10b5caa2.tar.gz wallabag-8ca858ee7301ea332baa9ad9543bb72d10b5caa2.tar.zst wallabag-8ca858ee7301ea332baa9ad9543bb72d10b5caa2.zip |
Fix PHP warning
Looks like sometimes (usually from import) the `html` key isn’t available.
Diffstat (limited to 'src')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/ContentProxy.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index d38811a2..31953f12 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php | |||
@@ -256,18 +256,17 @@ class ContentProxy | |||
256 | $entry->setTitle($content['open_graph']['og_title']); | 256 | $entry->setTitle($content['open_graph']['og_title']); |
257 | } | 257 | } |
258 | 258 | ||
259 | $html = $content['html']; | 259 | if (empty($content['html'])) { |
260 | if (false === $html) { | 260 | $content['html'] = $this->fetchingErrorMessage; |
261 | $html = $this->fetchingErrorMessage; | ||
262 | 261 | ||
263 | if (!empty($content['open_graph']['og_description'])) { | 262 | if (!empty($content['open_graph']['og_description'])) { |
264 | $html .= '<p><i>But we found a short description: </i></p>'; | 263 | $content['html'] .= '<p><i>But we found a short description: </i></p>'; |
265 | $html .= $content['open_graph']['og_description']; | 264 | $content['html'] .= $content['open_graph']['og_description']; |
266 | } | 265 | } |
267 | } | 266 | } |
268 | 267 | ||
269 | $entry->setContent($html); | 268 | $entry->setContent($content['html']); |
270 | $entry->setReadingTime(Utils::getReadingTime($html)); | 269 | $entry->setReadingTime(Utils::getReadingTime($content['html'])); |
271 | 270 | ||
272 | if (!empty($content['status'])) { | 271 | if (!empty($content['status'])) { |
273 | $entry->setHttpStatus($content['status']); | 272 | $entry->setHttpStatus($content['status']); |