mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-13 09:25:45 +01:00
more fixes
This commit is contained in:
@@ -42,7 +42,7 @@ define(function() {
|
||||
|
||||
pagination.loadPage = function(page, callback) {
|
||||
page = parseInt(page, 10);
|
||||
if(page < 1 || page > pagination.pageCount) {
|
||||
if(!utils.isNumber(page) || page < 1 || page > pagination.pageCount) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1018,6 +1018,9 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
||||
|
||||
if(config.usePagination) {
|
||||
socket.emit('posts.getPidPage', pid, function(err, page) {
|
||||
if(err) {
|
||||
return;
|
||||
}
|
||||
if(parseInt(page, 10) !== pagination.currentPage) {
|
||||
pagination.loadPage(page);
|
||||
} else {
|
||||
|
||||
@@ -196,6 +196,7 @@
|
||||
template_data = data;
|
||||
parse_template();
|
||||
}).fail(function (data, textStatus) {
|
||||
jQuery('#content, #footer').stop(true, true).removeClass('ajaxifying');
|
||||
if (data && data.status == 404) {
|
||||
return ajaxify.go('404');
|
||||
} else if (data && data.status === 403) {
|
||||
|
||||
@@ -171,7 +171,7 @@ var path = require('path'),
|
||||
page = req.query.page;
|
||||
}
|
||||
|
||||
if(parseInt(page, 10) < 1) {
|
||||
if(!utils.isNumber(page) || parseInt(page, 10) < 1) {
|
||||
return res.send(404);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ var fs = require('fs'),
|
||||
posts = require('./../posts'),
|
||||
postTools = require('../postTools'),
|
||||
utils = require('./../../public/src/utils'),
|
||||
templates = require('./../../public/src/templates'),
|
||||
meta = require('./../meta'),
|
||||
db = require('./../database');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user