diff options
Diffstat (limited to 'app/Models/Feed.php')
| -rw-r--r-- | app/Models/Feed.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 4de61167b..710f8b557 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -611,6 +611,7 @@ class FreshRSS_Feed extends Minz_Model { $xPathItemTimestamp = $xPathSettings['itemTimestamp'] ?? ''; $xPathItemThumbnail = $xPathSettings['itemThumbnail'] ?? ''; $xPathItemCategories = $xPathSettings['itemCategories'] ?? ''; + $xPathItemUid = $xPathSettings['itemUid'] ?? ''; if ($xPathItem == '') { return null; } @@ -657,8 +658,14 @@ class FreshRSS_Feed extends Minz_Model { } } } - if ($item['title'] . $item['content'] . $item['link'] != '') { + if ($xPathItemUid != '') { + $item['guid'] = @$xpath->evaluate('normalize-space(' . $xPathItemUid . ')', $node); + } + if (empty($item['guid'])) { $item['guid'] = 'urn:sha1:' . sha1($item['title'] . $item['content'] . $item['link']); + } + + if ($item['title'] . $item['content'] . $item['link'] != '') { $item = Minz_Helper::htmlspecialchars_utf8($item); $view->entries[] = FreshRSS_Entry::fromArray($item); } |
