mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-29 14:48:52 +03:00
[InstagramBridge] added caption existance check in getInstagramStory (#865)
* [InstagramBridge] added caption existance check in getInstagramStory * [InstagramBridge] Coding policy fixes
This commit is contained in:
parent
e0323f06cd
commit
16f0ee7104
1 changed files with 5 additions and 1 deletions
|
@ -101,7 +101,11 @@ class InstagramBridge extends BridgeAbstract {
|
||||||
$mediaInfo = $data->entry_data->PostPage[0]->graphql->shortcode_media;
|
$mediaInfo = $data->entry_data->PostPage[0]->graphql->shortcode_media;
|
||||||
|
|
||||||
//Process the first element, that isn't in the node graph
|
//Process the first element, that isn't in the node graph
|
||||||
$caption = $mediaInfo->edge_media_to_caption->edges[0]->node->text;
|
if (count($mediaInfo->edge_media_to_caption->edges) > 0) {
|
||||||
|
$caption = $mediaInfo->edge_media_to_caption->edges[0]->node->text;
|
||||||
|
} else {
|
||||||
|
$caption = '';
|
||||||
|
}
|
||||||
|
|
||||||
$enclosures = [$mediaInfo->display_url];
|
$enclosures = [$mediaInfo->display_url];
|
||||||
$content = '<img src="' . htmlentities($mediaInfo->display_url) . '" alt="'. $caption . '" />';
|
$content = '<img src="' . htmlentities($mediaInfo->display_url) . '" alt="'. $caption . '" />';
|
||||||
|
|
Loading…
Reference in a new issue