Change Rss 2.0 item id generation
This commit is contained in:
parent
76bc123062
commit
ee17f9dad6
14
vendor/PicoFeed/Parsers/Rss20.php
vendored
14
vendor/PicoFeed/Parsers/Rss20.php
vendored
@ -218,12 +218,7 @@ class Rss20 extends Parser
|
|||||||
*/
|
*/
|
||||||
public function findItemId(SimpleXMLElement $entry, Item $item, Feed $feed)
|
public function findItemId(SimpleXMLElement $entry, Item $item, Feed $feed)
|
||||||
{
|
{
|
||||||
if ($entry->guid->count() > 0 && (string) $entry->guid['isPermaLink'] !== 'false') {
|
$item_permalink = $item->url;
|
||||||
$item_permalink = (string) $entry->guid;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$item_permalink = $item->url;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->isExcludedFromId($feed->url)) {
|
if ($this->isExcludedFromId($feed->url)) {
|
||||||
$feed_permalink = '';
|
$feed_permalink = '';
|
||||||
@ -232,7 +227,12 @@ class Rss20 extends Parser
|
|||||||
$feed_permalink = $feed->url;
|
$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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user