Fix PHP warning

Looks like sometimes (usually from import) the `html` key isn’t available.
This commit is contained in:
Jeremy Benoist 2019-03-18 06:23:41 +01:00
parent a48ff25d4c
commit 8ca858ee73
No known key found for this signature in database
GPG Key ID: BCA73962457ACC3C

View File

@ -256,18 +256,17 @@ class ContentProxy
$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']);