From 032d48ad7b180c80344a8fe64b2f9bfc81cef7b1 Mon Sep 17 00:00:00 2001 From: nextcloud486153 <78801830+nextcloud486153@users.noreply.github.com> Date: Mon, 18 Apr 2022 11:59:02 +0200 Subject: Fix malformed feeds (without GUIDs) stopping the update process (fixes #1738) Signed-off-by: nextcloud486153 <78801830+nextcloud486153@users.noreply.github.com> --- lib/Fetcher/FeedFetcher.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/Fetcher/FeedFetcher.php b/lib/Fetcher/FeedFetcher.php index 9e70b62ca..a6ddbacb5 100755 --- a/lib/Fetcher/FeedFetcher.php +++ b/lib/Fetcher/FeedFetcher.php @@ -18,6 +18,7 @@ use Favicon\Favicon; use FeedIo\Feed\ItemInterface; use FeedIo\FeedInterface; use FeedIo\FeedIo; +use FeedIo\Reader\ReadErrorException; use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Exception\ConnectException; @@ -233,6 +234,9 @@ class FeedFetcher implements IFeedFetcher $item = new Item(); $item->setUnread(true); $item->setUrl($parsedItem->getLink()); + if ($parsedItem->getPublicId() == null) { + throw new ReadErrorException("Malformed feed: item has no GUID"); + } $item->setGuid($parsedItem->getPublicId()); $item->setGuidHash(md5($item->getGuid())); -- cgit v1.2.3