mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-14 20:21:14 +03:00
[EconomistBridge] Fix if no article image present (#2328)
This commit is contained in:
parent
607d9297ff
commit
9dcce0ba1d
1 changed files with 6 additions and 2 deletions
|
@ -99,8 +99,12 @@ class EconomistBridge extends FeedExpander {
|
|||
$article = getSimpleHTMLDOM($item['uri']);
|
||||
// before the article can be added, it needs to be cleaned up, thus, the extra function
|
||||
$item['content'] = $this->cleanContent($article);
|
||||
// only the article lead image is retained
|
||||
$item['enclosures'][] = $article->find('div.article__lead-image', 0)->find('img', 0)->getAttribute('src');
|
||||
// only the article lead image is retained if it's there
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue