Clamp the imported timestamp within reasonable limits.

This commit is contained in:
akwizgran
2017-04-13 16:21:00 +01:00
parent 1b48d661e8
commit 115d488bc3

View File

@@ -467,11 +467,11 @@ class FeedManagerImpl implements FeedManager, Client, EventListener,
// get other information for post
GroupId groupId = feed.getBlogId();
long time;
long time, now = clock.currentTimeMillis();
Date date = entry.getUpdatedDate();
if (date == null) date = entry.getPublishedDate();
if (date == null) time = clock.currentTimeMillis();
else time = date.getTime();
if (date == null) time = now;
else time = Math.max(0, Math.min(date.getTime(), now));
String body = getPostBody(b.toString());
try {
// create and store post