Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@
(#315). Planet stops reading a feed past `planet.aggregator.fetch.maxBytes`
(5 MB) or `planet.aggregator.fetch.maxSeconds` (30 seconds), and fetches
only http and https URLs (#314).
- **Blogger and MetaWeblog return at most 200 recent entries**, including
when the requested count is zero or negative, as in 6.1.8.
- **AtomPub checks.** Publishing an entry through an AtomPub update needs the
permission to publish, media uploads over `uploads.file.maxsize` are
refused with 413 before they're stored, and entries show the creator's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ public Object getRecentPosts(String appkey, String blogid, String userid,
protected List<WeblogEntry> getRecentEntries(Weblog weblog, User user,
int requestedLimit, WeblogEntrySearchCriteria.SortBy sortBy,
Date endDate) throws Exception {
int effectiveLimit = requestedLimit <= 0 ? -1
int effectiveLimit = requestedLimit <= 0 ? DRAFT_SCAN_CAP
: Math.min(requestedLimit, DRAFT_SCAN_CAP);
WeblogEntryManager entryManager = WebloggerFactory.getWeblogger()
.getWeblogEntryManager();
Expand All @@ -560,7 +560,7 @@ protected List<WeblogEntry> getRecentEntries(Weblog weblog, User user,
entries.sort(Comparator.comparing(
WeblogEntry::getPubTime, newestFirst));
}
if (effectiveLimit > 0 && entries.size() > effectiveLimit) {
if (entries.size() > effectiveLimit) {
return new ArrayList<>(entries.subList(0, effectiveLimit));
}
return entries;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,14 @@ public void testRecentPostsAreFilteredForLimitedMembers() throws Exception {
handle, authorName, PASSWORD, 1000000);
assertEquals(BloggerAPIHandler.DRAFT_SCAN_CAP, metaBounded.size());

Vector<?> bloggerDefault = (Vector<?>) blogger.getRecentPosts(
"", handle, authorName, PASSWORD, 0);
assertEquals(bloggerBounded.size(), bloggerDefault.size());

Vector<?> metaDefault = (Vector<?>) metaWeblog.getRecentPosts(
handle, authorName, PASSWORD, -1);
assertEquals(metaBounded.size(), metaDefault.size());

@SuppressWarnings("unchecked")
Vector<Object> bloggerLegacy = (Vector<Object>) blogger.getRecentPosts(
"", handle, limitedName, PASSWORD, 0);
Expand Down