From 2744c13735b483c0048fbcf0e2642c04ffc730ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Wed, 14 Sep 2016 13:36:44 +0200 Subject: [PATCH] [FeedExpander] fix feeds using guid tag as item uri provider MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- lib/FeedExpander.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/FeedExpander.php b/lib/FeedExpander.php index 8de56a1..38b6ad0 100644 --- a/lib/FeedExpander.php +++ b/lib/FeedExpander.php @@ -151,6 +151,15 @@ abstract class FeedExpander extends BridgeAbstract { $namespaces = $feedItem->getNamespaces(true); if(isset($namespaces['dc'])) $dc = $feedItem->children($namespaces['dc']); + if(isset($feedItem->guid)){ + foreach($feedItem->guid->attributes() as $attribute=>$value){ + if($attribute === 'isPermaLink' && $value === "true"){ + $item['uri'] = $feedItem->guid; + break; + } + } + } + if(isset($feedItem->pubDate)){ $item['timestamp'] = strtotime($feedItem->pubDate); } elseif(isset($dc->date)){