summaryrefslogtreecommitdiffstats
path: root/utility
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-06-22 15:02:33 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-07-18 14:13:38 +0200
commit9807ee7d6b003b9dbef5eb4c78136f0e72d753ed (patch)
treee89178f33162edbf0a1bb2ef5e1c6f55057434b2 /utility
parent60f62a65069b63ed785756cb21a7a094cf5dd663 (diff)
use current date when feed does not provide pubdates, disable article updates
Diffstat (limited to 'utility')
-rw-r--r--utility/feedfetcher.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/utility/feedfetcher.php b/utility/feedfetcher.php
index fc301b31e..4706f7612 100644
--- a/utility/feedfetcher.php
+++ b/utility/feedfetcher.php
@@ -126,7 +126,15 @@ class FeedFetcher implements IFeedFetcher {
$item->setBody(str_replace('<a', '<a target="_blank"',
// escape XSS
$this->purifier->purify($simplePieItem->get_content())));
- $item->setPubDate($simplePieItem->get_date('U'));
+
+ // pubdate is not required. if not given use the current date
+ $date = $simplePieItem->get_date('U');
+ if(!$date) {
+ $date = $this->time->getTime();
+ }
+
+ $item->setPubDate($date);
+
$item->setLastModified($this->time->getTime());
$author = $simplePieItem->get_author();