summaryrefslogtreecommitdiffstats
path: root/lib/Fetcher/FeedFetcher.php
diff options
context:
space:
mode:
authornextcloud486153 <78801830+nextcloud486153@users.noreply.github.com>2022-04-18 11:59:02 +0200
committerBenjamin Brahmer <info@b-brahmer.de>2022-04-18 13:16:01 +0200
commit032d48ad7b180c80344a8fe64b2f9bfc81cef7b1 (patch)
treed8b7232194262b5b0fe1f326e99621aa1e36ec33 /lib/Fetcher/FeedFetcher.php
parent78c723f38acc16ac78ba6425ca0acfb2d432baf7 (diff)
Fix malformed feeds (without GUIDs) stopping the update process (fixes #1738)
Signed-off-by: nextcloud486153 <78801830+nextcloud486153@users.noreply.github.com>
Diffstat (limited to 'lib/Fetcher/FeedFetcher.php')
-rwxr-xr-xlib/Fetcher/FeedFetcher.php4
1 files changed, 4 insertions, 0 deletions
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()));