Skip to content

Commit 22c05da

Browse files
committed
Fix limit parameter
closes #3004 - parseInt for limit parameter
1 parent 0c00692 commit 22c05da

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/server/models/post.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,10 @@ Post = ghostBookshelf.Model.extend({
286286
var postCollection = Posts.forge(),
287287
tagInstance = options.tag !== undefined ? Tag.forge({slug: options.tag}) : false;
288288

289+
if (options.limit) {
290+
options.limit = parseInt(options.limit) || 15;
291+
}
292+
289293
options = this.filterOptions(options, 'findPage');
290294

291295
// Set default settings for options

0 commit comments

Comments
 (0)