summaryrefslogtreecommitdiffstats
path: root/lib/Fetcher/FeedFetcher.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Fetcher/FeedFetcher.php')
-rwxr-xr-xlib/Fetcher/FeedFetcher.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Fetcher/FeedFetcher.php b/lib/Fetcher/FeedFetcher.php
index 5a0f0e4e7..a1b7e08ec 100755
--- a/lib/Fetcher/FeedFetcher.php
+++ b/lib/Fetcher/FeedFetcher.php
@@ -206,7 +206,7 @@ class FeedFetcher implements IFeedFetcher
$item->setGuid($parsedItem->getPublicId());
$item->setGuidHash(md5($item->getGuid()));
- $lastmodified = $parsedItem->getLastModified() ?? new \DateTime();
+ $lastmodified = $parsedItem->getLastModified() ?? new DateTime();
if ($parsedItem->getValue('pubDate') !== null) {
$pubDT = new DateTime($parsedItem->getValue('pubDate'));
} elseif ($parsedItem->getValue('published') !== null) {
@@ -288,8 +288,9 @@ class FeedFetcher implements IFeedFetcher
$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
- $lastmodified = $feed->getLastModified() ?? new DateTime();
- $newFeed->setLastModified($lastmodified->getTimestamp());
+ if ($feed->getLastModified() instanceof DateTime) {
+ $newFeed->setHttpLastModified($feed->getLastModified()->format(DateTime::RSS));
+ }
$newFeed->setAdded($this->time->getTime());
if (!$getFavicon) {