Skip to content

Commit

Permalink
Fix PHP warning
Browse files Browse the repository at this point in the history
Looks like sometimes (usually from import) the `html` key isn’t available.
  • Loading branch information
j0k3r committed Mar 18, 2019
1 parent a48ff25 commit 8ca858e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Wallabag/CoreBundle/Helper/ContentProxy.php
Original file line number Diff line number Diff line change
@@ -256,18 +256,17 @@ private function stockEntry(Entry $entry, array $content)
$entry->setTitle($content['open_graph']['og_title']);
}

$html = $content['html'];
if (false === $html) {
$html = $this->fetchingErrorMessage;
if (empty($content['html'])) {
$content['html'] = $this->fetchingErrorMessage;

if (!empty($content['open_graph']['og_description'])) {
$html .= '<p><i>But we found a short description: </i></p>';
$html .= $content['open_graph']['og_description'];
$content['html'] .= '<p><i>But we found a short description: </i></p>';
$content['html'] .= $content['open_graph']['og_description'];
}
}

$entry->setContent($html);
$entry->setReadingTime(Utils::getReadingTime($html));
$entry->setContent($content['html']);
$entry->setReadingTime(Utils::getReadingTime($content['html']));

if (!empty($content['status'])) {
$entry->setHttpStatus($content['status']);

0 comments on commit 8ca858e

Please sign in to comment.