diff options
| author | 2022-08-18 12:10:55 +0200 | |
|---|---|---|
| committer | 2022-08-18 12:10:55 +0200 | |
| commit | 1603c10bbab61b4a84380c8a9d5aa77536a4f1c7 (patch) | |
| tree | 36ee76291c8e877d7421641ae7a38570ff65f8ce /app/Models/Feed.php | |
| parent | 4f111c5b305078a641d13ac41ce7d798e3cc19ce (diff) | |
XPath ability to define the UID manually (#4507)
* XPath ability to define the UID manually
* Fix error in i18n
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); } |
