diff options
author | Sean Molenaar <sean@seanmolenaar.eu> | 2020-10-12 21:12:53 +0200 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2020-10-12 21:40:23 +0200 |
commit | 48a130d3c0656e6e19dab7df0ea1837b26d3ee2e (patch) | |
tree | a838fd270b1b4f2aa68cc7c02ee07f118aeb45dd /lib/Fetcher/FeedFetcher.php | |
parent | bc918dd44363fb50161775a8d2c274c2c6a69f54 (diff) |
Allow titles to be null
Issue GH-867
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'lib/Fetcher/FeedFetcher.php')
-rwxr-xr-x | lib/Fetcher/FeedFetcher.php | 12 |
1 files changed, 8 insertions, 4 deletions
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()); // <link> attribute in the feed |