From 07b4c72d5de4d970b461baa6b31309f484d44097 Mon Sep 17 00:00:00 2001 From: hunhejj Date: Sat, 3 Nov 2018 12:12:37 +0100 Subject: [PATCH] [InstagramBridge] Don't add duplicated urls when parsing Instagram stories (#715) --- bridges/InstagramBridge.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bridges/InstagramBridge.php b/bridges/InstagramBridge.php index a4473822..d41f6967 100644 --- a/bridges/InstagramBridge.php +++ b/bridges/InstagramBridge.php @@ -111,10 +111,11 @@ class InstagramBridge extends BridgeAbstract { $content = ''. $caption . ''; foreach($mediaInfo->edge_sidecar_to_children->edges as $media) { - - $content .= ''. $caption . ''; - $enclosures[] = $media->node->display_url; - + $display_url = $media->node->display_url; + if(!in_array($display_url, $enclosures)) { // add only if not added yet + $content .= ''. $caption . ''; + $enclosures[] = $display_url; + } } return [$content, $enclosures];