From ee17f9dad6f3db57eeff3c475d3e26997fff2f81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Wed, 28 May 2014 19:16:36 -0400 Subject: [PATCH] Change Rss 2.0 item id generation --- vendor/PicoFeed/Parsers/Rss20.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vendor/PicoFeed/Parsers/Rss20.php b/vendor/PicoFeed/Parsers/Rss20.php index 5c7c4cf..3006cfa 100644 --- a/vendor/PicoFeed/Parsers/Rss20.php +++ b/vendor/PicoFeed/Parsers/Rss20.php @@ -218,12 +218,7 @@ class Rss20 extends Parser */ public function findItemId(SimpleXMLElement $entry, Item $item, Feed $feed) { - if ($entry->guid->count() > 0 && (string) $entry->guid['isPermaLink'] !== 'false') { - $item_permalink = (string) $entry->guid; - } - else { - $item_permalink = $item->url; - } + $item_permalink = $item->url; if ($this->isExcludedFromId($feed->url)) { $feed_permalink = ''; @@ -232,7 +227,12 @@ class Rss20 extends Parser $feed_permalink = $feed->url; } - $item->id = $this->generateId($item_permalink, $feed_permalink); + if ($entry->guid->count() > 0 && (string) $entry->guid['isPermaLink'] === 'false') { + $item->id = $this->generateId($item_permalink, $feed_permalink, (string) $entry->guid); + } + else { + $item->id = $this->generateId($item_permalink, $feed_permalink); + } } /**