mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
[EconomistBridge] Fix if no article image present (#2328)
This commit is contained in:
parent
607d9297ff
commit
9dcce0ba1d
@ -99,8 +99,12 @@ class EconomistBridge extends FeedExpander {
|
|||||||
$article = getSimpleHTMLDOM($item['uri']);
|
$article = getSimpleHTMLDOM($item['uri']);
|
||||||
// before the article can be added, it needs to be cleaned up, thus, the extra function
|
// before the article can be added, it needs to be cleaned up, thus, the extra function
|
||||||
$item['content'] = $this->cleanContent($article);
|
$item['content'] = $this->cleanContent($article);
|
||||||
// only the article lead image is retained
|
// only the article lead image is retained if it's there
|
||||||
$item['enclosures'][] = $article->find('div.article__lead-image', 0)->find('img', 0)->getAttribute('src');
|
if (!is_null($article->find('div.article__lead-image', 0))) {
|
||||||
|
$item['enclosures'][] = $article->find('div.article__lead-image', 0)->find('img', 0)->getAttribute('src');
|
||||||
|
} else {
|
||||||
|
$item['enclosures'][] = '';
|
||||||
|
}
|
||||||
|
|
||||||
return $item;
|
return $item;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user