From 48a130d3c0656e6e19dab7df0ea1837b26d3ee2e Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Mon, 12 Oct 2020 21:12:53 +0200 Subject: Allow titles to be null Issue GH-867 Signed-off-by: Sean Molenaar --- lib/Fetcher/FeedFetcher.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/Fetcher/FeedFetcher.php b/lib/Fetcher/FeedFetcher.php index ec7902f23..fa6d9a346 100755 --- a/lib/Fetcher/FeedFetcher.php +++ b/lib/Fetcher/FeedFetcher.php @@ -251,9 +251,11 @@ class FeedFetcher implements IFeedFetcher $item->setRtl($RTL); // unescape content because angularjs helps against XSS - $item->setTitle($this->decodeTwice($parsedItem->getTitle())); + if ($parsedItem->getTitle() !== null) { + $item->setTitle($this->decodeTwice($parsedItem->getTitle())); + } $author = $parsedItem->getAuthor(); - if (!is_null($author)) { + if ($author !== null && $author->getName() !== null) { $item->setAuthor($this->decodeTwice($author->getName())); } @@ -321,8 +323,10 @@ class FeedFetcher implements IFeedFetcher $newFeed = new Feed(); // unescape content because angularjs helps against XSS - $title = strip_tags($this->decodeTwice($feed->getTitle())); - $newFeed->setTitle($title); + if ($feed->getTitle() !== null) { + $title = strip_tags($this->decodeTwice($feed->getTitle())); + $newFeed->setTitle($title); + } $newFeed->setUrl($url); // the url used to add the feed $newFeed->setLocation($location); // the url where the feed was found $newFeed->setLink($feed->getLink()); // attribute in the feed -- cgit v1.2.3