mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-26 03:16:33 +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;
|
||||
|
||||
//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];
|
||||
$content = '<img src="' . htmlentities($mediaInfo->display_url) . '" alt="'. $caption . '" />';
|
||||
|
|
Loading…
Reference in a new issue